forked from dark_thunder/immich
fix(web): fetch error reporting (#7391)
This commit is contained in:
15
open-api/typescript-sdk/fetch-errors.ts
Normal file
15
open-api/typescript-sdk/fetch-errors.ts
Normal 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;
|
||||
}
|
@ -1 +1,2 @@
|
||||
export * from './fetch-client';
|
||||
export * from './fetch-errors';
|
||||
|
Reference in New Issue
Block a user