fix: only generate stack on HttpError if status >= 500 (#2470)
This commit is contained in:
+1
-3
@@ -1,5 +1,3 @@
|
||||
import { MODE } from "./runtime/server/mod.tsx";
|
||||
|
||||
export function getMessage(status: number): string {
|
||||
switch (status) {
|
||||
case 100:
|
||||
@@ -144,7 +142,7 @@ export class HttpError {
|
||||
public options?: ErrorOptions,
|
||||
) {
|
||||
this.message = message;
|
||||
if (MODE !== "production") {
|
||||
if (status >= 500) {
|
||||
this.#error = new Error();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user