@cashfarm/tractor
Version:
A Hapi server with superpowers
30 lines (29 loc) • 1.08 kB
TypeScript
import * as Hapi from 'hapi';
import * as Boom from 'boom';
export interface IDevErrorPayload extends Boom.Payload {
data: any;
stack: any;
}
export interface IDevError extends Boom.BoomError<any> {
output: {
/**
* statusCode - the HTTP status code (typically 4xx or 5xx).
*/
statusCode: number;
/**
* headers - an object containing any HTTP headers where each key
* is a header name and value is the header content.
* (Limited value type to string https://github.com/hapijs/boom/issues/151 )
*/
headers: {
[index: string]: string;
};
/**
* payload - the formatted object used as the response payload (stringified).
* Can be directly manipulated but any changes will be lost if reformat() is called.
* Any content allowed and by default includes the following content:
*/
payload: IDevErrorPayload;
};
}
export declare function betterErrors(request: Hapi.Request, reply: Hapi.ReplyWithContinue): Hapi.Response;