/**
|
* 获取HTTP状态码对应的错误说明
|
* @param status HTTP状态码
|
* @returns 错误说明文本
|
*/
|
export function getStatusCodeError(status: number): string {
|
switch (status) {
|
case 400:
|
return "Bad request - Invalid bid information";
|
case 401:
|
return "Unauthorized - Authentication required";
|
case 403:
|
return "Forbidden - Invalid CSRF token or insufficient permissions";
|
case 404:
|
return "Not found - Item does not exist or is下架";
|
case 409:
|
return "Conflict - Bid conflict or item status changed";
|
case 429:
|
return "Too many requests - Rate limit exceeded";
|
case 500:
|
return "Internal server error";
|
case 502:
|
return "Bad gateway";
|
case 503:
|
return "Service unavailable";
|
case 504:
|
return "Gateway timeout";
|
default:
|
return `Request failed with status: ${status}`;
|
}
|
}
|