Skip to main content
Module

x/domain_functions/src/index.ts>toErrorWithMessage

Decouple your business logic from your framework. With first-class type inference from end to end.
Go to Latest
function toErrorWithMessage
Re-export
import { toErrorWithMessage } from "https://deno.land/x/domain_functions@v2.6.0/src/index.ts";

Turns the given 'unknown' error into an ErrorWithMessage.

Examples

try {} catch (error) { const errorWithMessage = toErrorWithMessage(error) console.log(errorWithMessage.message) }

Parameters

maybeError: unknown

the error to turn into an ErrorWithMessage

Returns

the ErrorWithMessage