What problem does it solve?
Create and map ZerospinError instances to provide structured, stable error information for Effect-based code in zerospin. This helps when defining error codes/messages, wrapping causes, mapping/catching errors in Effects, or returning structured errors from Effect.gen/Effect.fn or promise boundaries.
Core Features & Use Cases
- Create ZerospinError objects with a stable code, human-readable message, and optional cause to standardize error handling across asynchronous flows.
- Map native errors to ZerospinError in Effect pipelines and return them from Effect.gen/Effect.fn when needed.
- Use in promise boundaries to ensure consistent error shape and metadata throughout the codebase.
Quick Start
Instantiate a ZerospinError with a stable code and message when an error occurs, e.g., new ZerospinError({ code: 'resource-not-found', message: 'Resource not found', cause: error }).