@rmtc/errors
v1.0.0
Published
Custom errors for the @rmtc/toolchain CLI
Downloads
123
Readme
@rmtc/errors
Custom errors for the @rmtc/toolchain CLI.
[!WARNING] This package is intended for internal use by @rmtc/toolchain. It's probably not useful by itself.
[!WARNING] This project is intended for use in @rowanmanning's projects. It's free to use but I don't offer support for use-cases outside of what I need.
Table of Contents
Requirements
This library requires the following to run:
- Node.js 18+
Usage
Install the module with npm:
npm install @rmtc/errors
This module exports error classes for use across the rest of this project:
const {ToolchainError} = require('@rmtc/errors');
throw new ToolchainError('this is a message');
You can pass a code
as a property on the second argument to the error constructor to provide a machine-readable alternative to the message:
throw new ToolchainError('this is a message', { code: 'EXAMPLE_CODE' });
Contributing
See the central README for a contribution guide and code of conduct.
License
Licensed under the MIT license. Copyright © 2023, Rowan Manning