lefengyang
2026-08-20 d01a28cb030b2cb0ff1d42273c877a0f728519a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
 * 获取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}`;
  }
}