method ErrorUtils.wrap
ErrorUtils.wrap(
error: unknown,
context: string,
): Error

Wraps an error with additional context. Use this to add context when re-throwing errors.

Parameters

error: unknown
  • Original error
context: string
  • Additional context message

Return Type

Error

New error with context

Usage

import { ErrorUtils } from ".";