@daisugi/ayamari
This project is part of the @daisugi monorepo.
Ayamari helps you to create rich errors in a simple and consistent way.
Features
- Minimal size overhead (details)
- ️ Written in TypeScript
- Uses only trusted dependencies
- Powerful and agnostic to your code
- Well-tested
- Used in production
- Supports both ES Modules and CommonJS
Usage
import { Ayamari } from '@daisugi/ayamari';
const { errFn } = new Ayamari();
try {
eval('{');
} catch (err) {
errFn.UnexpectedError('Something went wrong.', {
cause: err,
});
}
Table of Contents
Installation
Using npm:
npm install @daisugi/ayamari
Using pnpm:
pnpm install @daisugi/ayamari
Overview
Ayamari improves error handling by simplifying the creation of rich, contextual errors. It enhances the legibility of exception output and provides useful features such as:
- No stack generation by default (for performance)
- Chained causes
- Additional properties for extra context
- Custom errors
- Pretty stack traces
- Error levels for categorization