fix: don't show error overlay on HttpError < 500 (#2462)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user