Package Exports
- es6-error
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (es6-error) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
es6-error
An easily-extendable error class for use with ES6 classes (or ES5, if you so choose).
ES6 Usage
import ExtendableError from 'es6-error';
class MyError extends ExtendableError {
// constructor is optional; you should omit it if you just want a custom error
// type for inheritance and type checking
constructor(message = 'Default message') {
super(message);
}
}
export default MyError;
ES5 Usage
var util = require('util');
var ExtendableError = require('es6-error');
function MyError(message) {
message = message || 'Default message';
ExtendableError.call(this, message);
}
util.inherits(MyError, ExtendableError);
module.exports = MyError;