libreccm-legacy/tools-ng/tinymce/plugins/ccm-cms-images/node_modules/create-error-class
baka 50ec8b6c4e [3056] Image plugin now in new directory. Also temporarly removes the toolbar button because its not working anyways. Running npm run build inside the plugin root will now compile the plugin into ccm-core.
git-svn-id: https://svn.libreccm.org/ccm/trunk@5740 8810af33-2d31-482b-a856-94f89814c4df
2018-11-21 10:20:00 +00:00
..
index.js [3056] Image plugin now in new directory. Also temporarly removes the toolbar button because its not working anyways. Running npm run build inside the plugin root will now compile the plugin into ccm-core. 2018-11-21 10:20:00 +00:00
license [3056] Image plugin now in new directory. Also temporarly removes the toolbar button because its not working anyways. Running npm run build inside the plugin root will now compile the plugin into ccm-core. 2018-11-21 10:20:00 +00:00
package.json [3056] Image plugin now in new directory. Also temporarly removes the toolbar button because its not working anyways. Running npm run build inside the plugin root will now compile the plugin into ccm-core. 2018-11-21 10:20:00 +00:00
readme.md [3056] Image plugin now in new directory. Also temporarly removes the toolbar button because its not working anyways. Running npm run build inside the plugin root will now compile the plugin into ccm-core. 2018-11-21 10:20:00 +00:00

readme.md

create-error-class Build Status

Create error class

Install

$ npm install --save create-error-class

Usage

var createErrorClass = require('create-error-class');

var HTTPError = createErrorClass('HTTPError', function (props) {
	this.message = 'Status code is ' + props.statusCode;
});

throw new HTTPError({statusCode: 404});

API

createErrorClass(className, [setup])

Return constructor of Errors with className.

className

Required
Type: string

Class name of Error Object. Should contain characters from [0-9a-zA-Z_$] range.

setup

Type: function

Setup function, that will be called after each Error object is created from constructor with context of Error object.

By default setup function sets this.message as first argument:

var MyError = createErrorClass('MyError');

new MyError('Something gone wrong!').message; // => 'Something gone wrong!'

License

MIT © Vsevolod Strukchinsky