This project is part of the @daisugi monorepo.
Ayamari helps you to create rich errors in a simple and consistent way.
- 💡 Minimum size overhead.
- ⚡️ Written in TypeScript.
- 📦 Only uses trusted dependencies.
- 🔨 Powerful and agnostic to your code.
- 🧪 Well tested.
- 🤝 Is used in production.
- ⚡️ Exports ES Modules as well as CommonJS.
import { Ayamari } from '@daisugi/ayamari';
const { errFn } = new Ayamari();
try {
eval('{');
} catch (err) {
errFn.UnexpectedError('Something went wrong.', {
cause: err,
});
}
Using npm:
npm install @daisugi/ayamari
Using yarn:
yarn add @daisugi/ayamari
Ayamari improves error handling for developers by simplifying the process and making it more manageable. It achieves this by enhancing the legibility of exception output and providing contextual rich errors with causes. The library includes several useful features:
- ✅ By default,
no stack
is generated for performance improvement. - ✅ Chains of causes.
- ✅ Properties to provide extra information about the error.
- ✅ Custom errors.
- ✅ Pretty stack traces.
- ✅ Levels for categorizing errors.