MCPcopy
hub / github.com/Wei-Shaw/sub2api / ApiErrorLike

Interface ApiErrorLike

frontend/src/utils/apiError.ts:8–22  ·  view source on GitHub ↗

* Centralized API error message extraction * * The API client interceptor rejects with a plain object: { status, code, message, error } * This utility extracts the user-facing message from any error shape.

Source from the content-addressed store, hash-verified

6 */
7
8interface ApiErrorLike {
9 status?: number
10 code?: number | string
11 message?: string
12 error?: string
13 reason?: string
14 metadata?: Record<string, unknown>
15 response?: {
16 data?: {
17 detail?: string
18 message?: string
19 code?: number | string
20 }
21 }
22}
23
24/**
25 * Extract the error code from an API error object.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected