1 | 'use strict';
|
2 |
|
3 | function EspowerError (message, stackStartFunction) {
|
4 | if (Error.captureStackTrace) {
|
5 | Error.captureStackTrace(this, stackStartFunction);
|
6 | } else {
|
7 | var _err = new Error();
|
8 | var _stack = _err.stack;
|
9 | if (!_stack) {
|
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 | }
|
20 | EspowerError.prototype = Object.create(Error.prototype);
|
21 | EspowerError.prototype.constructor = EspowerError;
|
22 | EspowerError.prototype.name = 'EspowerError';
|
23 |
|
24 | module.exports = EspowerError;
|