express-api-problem
Version:
A minimal package to assist in returning RESTful exceptions in your APIs
19 lines (18 loc) • 595 B
TypeScript
import { FormattedErrorType } from './mongoose-plugin';
export declare type ApiProblemOptionsType = {
status?: number;
title?: string;
detail?: string | FormattedErrorType[];
instance?: string;
additional?: Record<string, any>;
type?: string;
};
export declare type SpecErrorType = Omit<ApiProblemOptionsType, 'additional'> & Record<string, any>;
export declare class ApiProblem extends Error {
status: number;
title?: string;
detail?: string | FormattedErrorType[];
instance?: string;
type?: string;
constructor(props?: ApiProblemOptionsType);
}