@ash-framework/argument-error

Class for throwing descriptive user errors when bad arguments are passed to functions/classes

Usage no npm install needed!

<script type="module">
  import ashFrameworkArgumentError from 'https://cdn.skypack.dev/@ash-framework/argument-error';
</script>

README

@ash-framework/argument-error

The Media Suite

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status

Class for throwing descriptive user errors when bad arguments are passed to functions/classes

Install

NPM

  • Install: npm install --save @ash-framework/argument-error
  • Module: require('@ash-framework/argument-error')

Usage

const context = 'User'
const argumentName = 'name'
const additionalMessage = 'expected a "String" but a "Number" was given'
const error = new ArgumentError(context, argumentName, additionalMessage)

error.message
// 'Argument "name" given to "User" expected a "String" but a "Number" was given'

History

Discover the release history by heading on over to the releases page.

Backers

Maintainers

These amazing people are maintaining this project:

  • Richard Walker digitalsadhu@gmail.com

Sponsors

These amazing people have contributed finances to this project:

Become a sponsor!

Contributors

These amazing people have contributed code to this project:

License

Unless stated otherwise all works are:

and licensed under: