function internalServerError
Since 0.1.0
internalServerError(
message: string,
cause?: Error
): HttpError

Creates a 500 Internal Server Error error.

Pass the original error as cause so the root cause is preserved in the ES2022 error chain for logging and debugging.

Parameters

message: string

Human-readable error message

optional
cause: Error

Optional underlying error forwarded to the cause chain

Return Type

Usage

import { internalServerError } from "exceptions/src/index.ts";