{"name":"create-error-class","version":"2.0.1","description":"Create Error classes","license":"MIT","repository":{"type":"git","url":"https://github.com/floatdrop/create-error-class"},"author":{"name":"Vsevolod Strukchinsky","email":"floatdrop@gmail.com","url":"github.com/floatdrop"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":[],"dependencies":{"capture-stack-trace":"^1.0.0","inherits":"^2.0.1"},"devDependencies":{"mocha":"*"},"gitHead":"bec0186ac350c5b89b1707d395c23a5a080b4f45","bugs":{"url":"https://github.com/floatdrop/create-error-class/issues"},"homepage":"https://github.com/floatdrop/create-error-class","_id":"create-error-class@2.0.1","_shasum":"a8759ed5c8d214a461e81d18e70aacb33dd63c9c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"floatdrop","email":"floatdrop@gmail.com"},"maintainers":[{"name":"floatdrop","email":"floatdrop@gmail.com"}],"dist":{"shasum":"a8759ed5c8d214a461e81d18e70aacb33dd63c9c","tarball":"http://registry-npm.ywwl.com/create-error-class/download/create-error-class-2.0.1.tgz","integrity":"sha512-xNYa5/2iQ0C7xWaLLzW5kBkkDCHCjxXuHswRmuNopmZxlWyEjmTIyX4m8tRa+U9+mRwpRiTygMWd0TCxh7wvxg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHtv8FjugQ2NyNNmLW+YaBSAvwu6myQUcEpy2xqb35ykAiAiBrO+1C9+wpIk2RCXjAYI9aN6jTxjSCaNi2hN1yLiNQ=="}],"size":1184,"noattachment":false,"key":"/create-error-class/-/create-error-class-2.0.1.tgz"},"directories":{},"readme":"# create-error-class [![Build Status](https://travis-ci.org/floatdrop/create-error-class.svg?branch=master)](https://travis-ci.org/floatdrop/create-error-class)\n\n> Create error class\n\n\n## Install\n\n```\n$ npm install --save create-error-class\n```\n\n\n## Usage\n\n```js\nvar createErrorClass = require('create-error-class');\n\nvar HTTPError = createErrorClass('HTTPError', function (props) {\n\tthis.message = 'Status code is ' + props.statusCode;\n});\n\nthrow new HTTPError({statusCode: 404});\n```\n\n\n## API\n\n### createErrorClass(className, [setup])\n\nReturn constructor of Errors with `className`.\n\n#### className\n\n*Required*  \nType: `string`\n\nClass name of Error Object. Should contain characters from `[0-9a-zA-Z_$]` range.\n\n#### setup\nType: `function`\n\nSetup function, that will be called after each Error object is created from constructor with context of Error object.\n\nBy default `setup` function sets `this.message` as first argument:\n\n```js\nvar MyError = createErrorClass('MyError');\n\nnew MyError('Something gone wrong!').message; // => 'Something gone wrong!'\n```\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n","publish_time":1437985161871,"_cnpm_publish_time":1437985161871,"dist-tags":{"latest":"3.0.2"}}