Skip to content

errorToString

Converts an error to a string representation, including nested causes and the aggregated errors of an AggregateError, with indentation.

Import:

import { errorToString } from '@mnaoumov/typescript-lib/error';

Signature:

function errorToString(error: unknown): string

Parameters:

Parameter Type Description
error unknown The error to convert to a string.

Returns: string — The string representation of the error.