We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcadf74 commit 74c55c4Copy full SHA for 74c55c4
2 files changed
src/error.ts
@@ -142,8 +142,5 @@ export class HttpError extends Error {
142
super(message, options);
143
this.name = this.constructor.name;
144
this.status = status;
145
- if (status >= 500) {
146
- this.stack = new Error().stack;
147
- }
148
}
149
src/error_test.ts
@@ -1,10 +1,10 @@
1
import { expect } from "@std/expect";
2
import { HttpError } from "./error.ts";
3
4
-Deno.test("HttpError - contains stack if error >=500", () => {
+Deno.test("HttpError - contains stack", () => {
5
const err = new HttpError(404);
6
expect(err.status).toEqual(404);
7
- expect(typeof err.stack).toEqual("undefined");
+ expect(typeof err.stack).toEqual("string");
8
9
const err2 = new HttpError(500);
10
expect(err2.status).toEqual(500);
0 commit comments