원클릭으로
api-error-handling
Standardized error format, error code clusters, and API client usage for consistent error handling.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Standardized error format, error code clusters, and API client usage for consistent error handling.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
ZGO API development standards including pagination, error handling, and RESTful design
Test patterns, mocking strategies, and organization best practices
Specifications for Zustand stores, React Query hooks, and the Service-Hook-Type pattern with optimistic updates.
Strict rules for environment variable management using Zod validation and src/config/env.ts.
Guidelines for managing internationalization (i18n) in the project using next-intl and unified translation patterns.
High-level overview of project structure, mock API architecture, and authentication flow.
| name | api-error-handling |
| description | Standardized error format, error code clusters, and API client usage for consistent error handling. |
This skill ensures consistent error handling between the frontend and backend. It defines a standardized error response format and a system of error code clusters to categorize and handle issues effectively.
All error responses from the backend (BFF or mock) MUST follow this format:
{
"error": "Human-readable error message",
"code": "CATEGORY_DESCRIPTION"
}
Error codes follow the format [CATEGORY]_[DESCRIPTION]. Use the ErrorCode constant from @/http/codes for comparison.
| Category | Prefix | Description | Examples |
|---|---|---|---|
| System | SYS_ | Infrastructural or unexpected errors | SYS_SERVER_ERROR, SYS_TIMEOUT |
| Auth | AUTH_ | Authentication and authorization issues | AUTH_TOKEN_EXPIRED, AUTH_FORBIDDEN |
| Validation | VAL_ | Input parameter or schema validation | VAL_MISSING_FIELD, VAL_INVALID_PARAMS |
| Business | BIZ_ | Business logic constraints | BIZ_RESOURCE_NOT_FOUND, BIZ_ALREADY_EXISTS |
ErrorCode from @/http/codes to check for specific error types.HttpClient and passed to handleError (toast notification, etc.).skipErrorHandler: true in the request configuration to handle errors manually within components or hooks.try {
await request.post('/resource', data, { skipErrorHandler: true });
} catch (error) {
if (error.code === ErrorCode.BIZ_ALREADY_EXISTS) {
// Custom logic
}
}
[!IMPORTANT] Consistency: Ensure that backend error codes align with the frontend constants to maintain a robust UX.