Miscue
Miscue class for Decanat, to provide better interface to HTTP errors and status in general.
var Miscue = ;// instantiatevar status = 422 email: 'improper' ;// playstatus instanceof Error; // returns true; // alerts 'client error (422): {"email":"improper"}'
Installation
Install with component:
$ component install decanat/miscue
API
Set custom name
var status = 422 email: 'improper' ;// status.name === 'client error' status;// status.name === 'validation error' status;// status.name === 'client error'
Mark as Error
var status = 600 'coffee break';// status instanceof Error === false status;// status instanceof Error === true
Testing
To test with PhantomJS, run:
$ make test
License
The MIT License (MIT)