Skip to content

Commit 74c55c4

Browse files
committed
fix
1 parent bcadf74 commit 74c55c4

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

src/error.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,5 @@ export class HttpError extends Error {
142142
super(message, options);
143143
this.name = this.constructor.name;
144144
this.status = status;
145-
if (status >= 500) {
146-
this.stack = new Error().stack;
147-
}
148145
}
149146
}

src/error_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { expect } from "@std/expect";
22
import { HttpError } from "./error.ts";
33

4-
Deno.test("HttpError - contains stack if error >=500", () => {
4+
Deno.test("HttpError - contains stack", () => {
55
const err = new HttpError(404);
66
expect(err.status).toEqual(404);
7-
expect(typeof err.stack).toEqual("undefined");
7+
expect(typeof err.stack).toEqual("string");
88

99
const err2 = new HttpError(500);
1010
expect(err2.status).toEqual(500);

0 commit comments

Comments
 (0)