@meshwatch/backend-core
Version:
Meshwatch backend core services.
30 lines (29 loc) • 1.13 kB
TypeScript
import { Boom as InternalBoom } from '@meshwatch/types';
import { TypedBoom } from '../validation';
export declare function validationBoom<T>(errors?: T): InternalBoom<T>;
export declare function boomify<T>(error: Error, options?: {
statusCode?: number;
message?: string;
override?: boolean;
}): InternalBoom<T>;
export declare function isBoom<T, R = undefined>(body: T | TypedBoom<R>): body is TypedBoom<R>;
declare abstract class ServiceException extends Error {
httpStatusCode: number;
constructor(message: string, httpStatusCode: number, name: string);
}
export declare class DatabaseException extends ServiceException {
constructor(message: string);
}
export declare class NotFoundException extends ServiceException {
constructor(message: string);
}
export declare class ForbiddenException extends ServiceException {
constructor(message: string);
}
export declare class BadRequestException extends ServiceException {
constructor(message: string);
}
export declare class UnreachableCaseError extends ServiceException {
constructor(val: never);
}
export {};