Neverthrow Wrap Exceptions

Capture exceptions and promise failures with `neverthrow` instead of hand-written `try/catch` in TypeScript and JavaScript code. Use when wrapping synchronous functions that may throw, promise-returning functions that may throw before returning, existing `PromiseLike` values that may reject, or third-party APIs such as parsers, database clients, HTTP clients, file-system helpers, serializers, and SDK calls. Prefer `Result.fromThrowable` for synchronous throwers, `ResultAsync.fromThrowable` for promise-returning functions that may throw or reject, and `ResultAsync.fromPromise` when you already have a `PromiseLike` value in hand. Only keep `try/catch` when the language construct, cleanup requirement, or framework boundary truly requires it. Use when this capability is needed.

tomevault-io c4d3035 2 files · 6.0 KB Updated

File contents

tomevault-io/skills-registry/tree/main/code-sherpas--agent-skills--neverthrow-wrap-exceptions commit c4d3035d4d

Frequently asked questions

npx skillmds@latest add tomevault-io/neverthrow-wrap-exceptions