GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - orinak/miscue: Something like Error, with status code

BranchesTags
Open more actions menu

Latest commit

 

History

43 Commits
43 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
component.json
component.json
 
 
index.js
index.js
 
 
package.json
package.json
 
 

Repository files navigation

Miscue Build Status

Miscue class for Decanat, to provide better interface to HTTP errors and status in general.

var Miscue = require('miscue');
// instantiate
var status = new Miscue(422, { email: 'improper' });
// play
status instanceof Error; // returns true
alert(status); // alerts 'client error (422): {"email":"improper"}'

Installation

Install with component:

$ component install decanat/miscue

API

Set custom name

var status = new Miscue(422, { email: 'improper' });
// status.name === 'client error'

status.set('validation error');
// status.name === 'validation error'

status.set(422);
// status.name === 'client error'

Mark as Error

var status = new Miscue(600, 'coffee break');
// status instanceof Error === false

status.turnError();
// status instanceof Error === true

Testing

To test with PhantomJS, run:

$ make test    

License

The MIT License (MIT)

About

Something like Error, with status code

Resources

Readme
License
Activity
Custom properties

Stars

0 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.