espower-error.js 675 B

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