blong-error

Define and throw typed errors with HTTP status codes in Blong.

1|Updated Dec 21, 2023
One-click install
npx skills add https://github.com/feasibleone/blong --skill blong-error
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: blong-error
Source: https://github.com/feasibleone/blong/tree/main/.github/skills/error
Command: npx skills add https://github.com/feasibleone/blong --skill blong-error

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Blong applications need structured, typed errors to convey precise failure reasons, HTTP status context, and safe propagation across realms.

Core Features & Use Cases

  • Centralized error definitions: define error keys once and reuse them across handlers.
  • Parameterized messages: inject dynamic values into error messages for clear reporting.
  • Error wrapping & HTTP status: attach a cause and statusCode to propagate context through layers.
  • Use cases: domain validation, API error responses, and consistent error handling in orchestration flows.

Quick Start

Define a new error key in error/error.ts, then throw it from a handler to demonstrate domain error handling.

Frequently Asked Questions about blong-error

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

FAQPage Schema
How do I define and throw typed errors with HTTP status codes in a Blong application?

To define typed errors in Blong, you create centralized error keys using dot-notated notation, attach HTTP status codes, and throw them from handlers to enforce structured error handling across API layers.

What is the best way to handle domain validation errors and return consistent API responses?

Handling domain validation errors requires parameterized messages that inject dynamic values into error definitions. This approach ensures consistent API responses by conveying precise failure reasons and HTTP status context.

Do I need TypeScript to use structured error handling in the Blong framework?

Yes, TypeScript support is required to use structured error handling in the Blong framework. The environment relies on TypeScript to define and throw typed errors with parameterized messages and error wrapping.

How does error wrapping work when propagating context through application layers?

Error wrapping propagates context through application layers by attaching an optional cause to the error definition. This allows runtime conditions and domain validation failures to be traced across realms.

Can I reuse error definitions across multiple handlers for orchestration flows?

Yes, you can define error keys once in a centralized location and reuse them across multiple handlers. This ensures consistent error handling in orchestration flows and API responses throughout the application.