Skip to content

Function: errorMessage()

errorMessage(value): string

Extract a human-readable message from any thrown value. Returns value.message when value is an Error, otherwise coerces via String(value). Collapses the ubiquitous

err instanceof Error ? err.message : String(err)

dance into a single helper, useful for log attributes and any other “give me something printable” context.

unknown

string