fix(web): fetch error reporting (#7391)

This commit is contained in:
Michel Heusschen
2024-02-27 03:48:47 +01:00
committed by GitHub
parent 8a05ff51e9
commit c8bdeb8fec
4 changed files with 43 additions and 32 deletions

View File

@ -0,0 +1,15 @@
import { HttpError } from '@oazapfts/runtime';
export interface ApiExceptionResponse {
message: string;
error?: string;
statusCode: number;
}
export interface ApiHttpError extends HttpError {
data: ApiExceptionResponse;
}
export function isHttpError(error: unknown): error is ApiHttpError {
return error instanceof HttpError;
}

View File

@ -1 +1,2 @@
export * from './fetch-client';
export * from './fetch-errors';