error-handling

Implement consistent API error handling with Korean messages and server-side logging.

Updated Dec 15, 2025
One-click install
npx skills add https://github.com/jhlee0409/sidedish --skill error-handling-jhlee0409
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/jhlee0409/sidedish/tree/main/.claude/skills/error-handling
Command: npx skills add https://github.com/jhlee0409/sidedish --skill error-handling-jhlee0409

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes references (resource) components.

What problem does it solve?

์ผ๊ด€๋œ API ์—๋Ÿฌ ์‘๋‹ต๊ณผ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ํŒจํ„ด์„ ํ†ตํ•ด ์„œ๋ฒ„์™€ ํด๋ผ์ด์–ธํŠธ์˜ ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋ฅผ ๋‹จ์ˆœํ™”ํ•ฉ๋‹ˆ๋‹ค. ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋Š” ํ•œ๊ธ€๋กœ ์ œ๊ณต๋˜๋ฉฐ ๋กœ๊น…์€ ์„œ๋ฒ„์—๋งŒ ๋‚จ๊น๋‹ˆ๋‹ค.

Core Features & Use Cases

  • ์ผ๊ด€๋œ ์ƒํƒœ ์ฝ”๋“œ์™€ ๋ฉ”์‹œ์ง€: 400/401/403/404/429/500 ๋“ฑ ํ‘œ์ค€ํ™”๋œ ์‘๋‹ต.
  • ํด๋ผ์ด์–ธํŠธ-์‚ฌ์ด๋“œ ApiError ํด๋ž˜์Šค: ํด๋ผ์ด์–ธํŠธ์—์„œ ํƒ€์ž… ์•ˆ์ „ํ•œ ์˜ค๋ฅ˜ ๋‹ค๋ฃจ๊ธฐ.
  • ์„œ๋ฒ„-์‚ฌ์ด๋“œ ๋กœ๊น… ๋ฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ํŒจํ„ด: try/catch, ๋กœ๊ทธ, ์žฌ์‹œ๋„ ์ „๋žต ์˜ˆ์‹œ.

Quick Start

๊ธฐ์กด API ๊ฒฝ๋กœ๋ฅผ ๋ฆฌํŒฉํ† ๋งํ•˜์—ฌ ์ž˜๋ชป๋œ ์ž…๋ ฅ์— ๋Œ€ํ•ด ํ•œ๊ตญ์–ด ์ƒ์„ธ ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ ์ ์ ˆํ•œ ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

Frequently Asked Questions about error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement consistent error handling across API endpoints and client components?โ–ผ

Consistent error handling uses standardized HTTP status codes (400, 401, 403, 404, 429, 500) with centralized error messages, server-side logging patterns, and a client-side ApiError class for type-safe exception handling across all layers.

What's the best way to handle API errors on the client side with type safety?โ–ผ

Use a dedicated ApiError class to wrap API responses, enabling type-safe error handling in client components. This pattern provides consistent access to error codes and messages while integrating with UI patterns like toast notifications and retry logic.

How do I set up server-side logging and error patterns for APIs?โ–ผ

Implement try/catch blocks in API endpoints with centralized logging that captures exceptions server-side only. Standardize response formats with appropriate HTTP status codes and error messages, enabling reliable diagnostics without exposing logs to clients.

Can I use this error handling pattern with validation and retry strategies?โ–ผ

Yes. The pattern enforces standard validation error responses (400) alongside retry-friendly status codes (429), supporting client-side retry logic and toast notifications for user-facing feedback across validation failures and transient errors.

What validation errors should I return from API endpoints?โ–ผ

Return 400 Bad Request with detailed validation error messages from a centralized dictionary. Include specific field-level validation failures so clients can display precise, actionable feedback to users.

Do I need separate error handling for different API status codes?โ–ผ

Use a unified error handling framework with status-code-specific handling: 401 for authentication, 403 for authorization, 404 for resources, 429 for rate limits, and 500 for server errorsโ€”all returning consistent message structures.