Merge pull request #14245 from dcherman/http_errors_headers

[http-headers]: Add the `headers` property to the exported interface
This commit is contained in:
Daniel Rosenwasser
2017-01-25 12:10:45 -08:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@ console.log(err.message);
console.log(err.status);
console.log(err.statusCode);
console.log(err.expose);
console.log(err.headers);
// createError(status, msg)
var err = createError(404, 'LOL');
+3
View File
@@ -11,6 +11,9 @@ declare module 'http-errors' {
status: number;
statusCode: number;
expose: boolean;
headers?: {
[key: string]: string
};
}
type HttpErrorConstructor = new(msg?: string) => HttpError;