Function: formatErrorToString()

formatErrorToString(error, defaultErrorString?, opts?): string

Formats an error object into a string representation.

Parameters

error

unknown

The error to format. It can be an Error instance, a string, or another object.

defaultErrorString?

string = ''

The default error message if the error cannot be formatted.

opts?

Additional options.

errorLimit

number = 8

The maximum number of stack trace lines to include.

Returns

string

The formatted error message.