2024-02-27 03:48:47 +01:00
|
|
|
import { HttpError } from '@oazapfts/runtime';
|
|
|
|
|
|
2026-05-04 06:00:03 +02:00
|
|
|
export interface ApiValidationError {
|
|
|
|
|
code: string;
|
|
|
|
|
path: (string | number)[];
|
|
|
|
|
message: string;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-27 03:48:47 +01:00
|
|
|
export interface ApiExceptionResponse {
|
|
|
|
|
message: string;
|
|
|
|
|
error?: string;
|
|
|
|
|
statusCode: number;
|
2026-05-04 06:00:03 +02:00
|
|
|
errors?: ApiValidationError[];
|
2024-02-27 03:48:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ApiHttpError extends HttpError {
|
|
|
|
|
data: ApiExceptionResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function isHttpError(error: unknown): error is ApiHttpError {
|
|
|
|
|
return error instanceof HttpError;
|
|
|
|
|
}
|