refactor(frontend): add ApiError interface and extractErrorCode helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-20 20:47:23 +02:00
committed by marcel
parent 3fa0f59529
commit 1a7e4ce536

View File

@@ -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;
}