add default value in forwarder error

This commit is contained in:
rafiarrafif
2025-05-27 05:10:27 +07:00
parent a7c984b316
commit 85bc85618b
11 changed files with 81 additions and 48 deletions

View File

@ -1,9 +1,9 @@
import { AppError } from "./app";
export function ErrorForwarder(
statusCode: number,
message: string,
cause: unknown
cause: unknown,
statusCode: number = 500,
message: string = "Unexpected error"
): never {
if (cause instanceof AppError) {
throw cause;