diff --git a/frontend/src/lib/shared/api.server.ts b/frontend/src/lib/shared/api.server.ts index 126834ba..b1aab396 100644 --- a/frontend/src/lib/shared/api.server.ts +++ b/frontend/src/lib/shared/api.server.ts @@ -23,3 +23,12 @@ export function createApiClient(fetch: typeof globalThis.fetch) { fetch }); } + +export interface ApiError { + code?: string; + message?: string; +} + +export function extractErrorCode(error: unknown): string | undefined { + return (error as ApiError | undefined)?.code; +}