UNPKG

675 BJavaScriptView Raw
1'use strict';
2
3function EspowerError (message, stackStartFunction) {
4 if (Error.captureStackTrace) { // V8
5 Error.captureStackTrace(this, stackStartFunction);
6 } else {
7 var _err = new Error();
8 var _stack = _err.stack;
9 if (!_stack) { // IE10
10 try {
11 throw _err;
12 } catch (e) {
13 _stack = e.stack;
14 }
15 }
16 this.stack = _stack;
17 }
18 this.message = '[espower] ' + message;
19}
20EspowerError.prototype = Object.create(Error.prototype);
21EspowerError.prototype.constructor = EspowerError;
22EspowerError.prototype.name = 'EspowerError';
23
24module.exports = EspowerError;