Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
2 folders · 5 files
README.md
module-caught-value #
Ready to publish.
Formats values caught from catch blocks without discarding diagnostic information.
caughtValueText returns Error.message for genuine Error values.
caughtValueStack prefers Error.stack and falls back to that message.
For every other value,
both helpers follow JavaScript string conversion so objects can provide diagnostic text through Symbol.toPrimitive,
toString,
or valueOf.
Those hooks can execute caller-defined behavior,
so both functions expose that uncertainty through their @mutates value contracts.
import { caughtValueText, } from '@monochromatic-dev/module-caught-value';
caughtValueText(new Error('offline')); // 'offline'
caughtValueText({ toString: () => 'provider details' }); // 'provider details'