diff --git a/public/HttpError.js b/public/HttpError.js index f142b8e..59a26e3 100644 --- a/public/HttpError.js +++ b/public/HttpError.js @@ -9,6 +9,7 @@ module.exports = class HttpError extends Error { constructor(status, message) { super(message); this.status = status; + this.statusCode = status; this.expose = true; this.name = errorNames[status]; } diff --git a/test/public/graphqlUploadExpress.test.js b/test/public/graphqlUploadExpress.test.js index b77d2a2..c583c17 100644 --- a/test/public/graphqlUploadExpress.test.js +++ b/test/public/graphqlUploadExpress.test.js @@ -133,6 +133,7 @@ describe("graphqlUploadExpress", () => { deepStrictEqual(expressError, error); strictEqual(responseStatusCode, error.status); + strictEqual(responseStatusCode, error.statusCode); } finally { close(); }