result-error-handling

Standardizes Result-based error handling for brepjs operations with kernelCall and BrepError construction.

77|7|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/andymai/brepjs --skill result-error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: result-error-handling
Source: https://github.com/andymai/brepjs/tree/main/.claude/skills/result-error-handling
Command: npx skills add https://github.com/andymai/brepjs --skill result-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the common pain points of inconsistent error handling in brepjs projects, which often lead to silent failures, cryptic uncaught kernel errors, and invalid geometry that is extremely difficult to debug.

Core Features & Use Cases

  • Standardized Result workflow: Teaches proper use of brepjs Result<T,E> combinators, correct error channel selection for expected vs unexpected failures, and proper propagation of fallible operation results.
  • Error construction best practices: Covers how to use kernelCall for kernel operations, add actionable context via metadata and recovery suggestions, and avoid common pitfalls like dropped error causes or typo'd error codes.
  • Use case: When adding a new brepjs operation that can fail (such as a fillet, cut, or STEP export), use this Skill to ensure errors are returned as Results with clear, actionable messages instead of throwing unexpected exceptions or swallowing failures entirely.

Quick Start

Use the result-error-handling skill to implement proper Result-based error handling for your new brepjs boolean operation, including adding a custom BrepErrorCode and recovery suggestion for when the kernel reports a failed fuse.

Frequently Asked Questions about result-error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle silent failures in brepjs operations?

To handle silent failures in brepjs operations, use the Result type to return errors with clear, actionable messages instead of throwing unexpected exceptions or swallowing failures entirely.

What's the best way to propagate kernel errors in brepjs?

The best way to propagate kernel errors in brepjs is by using kernelCall for kernel operations, ensuring errors are returned as Results with proper metadata and recovery suggestions rather than cryptic uncaught exceptions.

How do I construct a BrepError with actionable recovery suggestions?

You construct a BrepError with actionable recovery suggestions by adding context via metadata and recovery hints, avoiding common pitfalls like dropped error causes or typo'd error codes during construction.

When should I use Result combinators for error handling in brepjs?

You should use Result combinators for error handling in brepjs whenever adding fallible operations like fillet, cut, or STEP export, ensuring proper error channel selection for expected versus unexpected failures.

Why does my brepjs code produce invalid geometry after a failed operation?

Your brepjs code produces invalid geometry after a failed operation due to inconsistent error handling that causes silent failures, which you can prevent by enforcing correct throwing boundaries and standardizing Result propagation.