fix: don't show error overlay on HttpError < 500 (#2462)

This commit is contained in:
Marvin Hagemeister
2024-05-24 23:46:21 +02:00
committed by GitHub
parent 2b1de48ff1
commit f9545c3d63
2 changed files with 35 additions and 0 deletions
+6
View File
@@ -31,6 +31,7 @@ import {
} from "../../dev/middlewares/error_overlay/code_frame.tsx";
import * as colors from "@std/fmt/colors";
import { escape as escapeHtml } from "@std/html";
import { HttpError } from "../../error.ts";
const enum OptionsType {
ATTR = "attr",
@@ -502,6 +503,11 @@ export function ShowErrorOverlay() {
if (error === null || error === undefined) return null;
// Ignore HTTP errors <500
if (error instanceof HttpError && error.status < 500) {
return null;
}
const basePath = ctx.config.basePath;
const searchParams = new URLSearchParams();