'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var _classCallCheck = _interopDefault(require('@babel/runtime/helpers/classCallCheck'));
var _possibleConstructorReturn = _interopDefault(require('@babel/runtime/helpers/possibleConstructorReturn'));
var _getPrototypeOf = _interopDefault(require('@babel/runtime/helpers/getPrototypeOf'));
var _assertThisInitialized = _interopDefault(require('@babel/runtime/helpers/assertThisInitialized'));
var _inherits = _interopDefault(require('@babel/runtime/helpers/inherits'));
var _wrapNativeSuper = _interopDefault(require('@babel/runtime/helpers/wrapNativeSuper'));

/**
 * exception base class
 */
var Exception =
/*#__PURE__*/
function (_Error) {
  _inherits(Exception, _Error);

  function Exception(message) {
    var _this;

    var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Exception;

    _classCallCheck(this, Exception);

    _this = _possibleConstructorReturn(this, _getPrototypeOf(Exception).call(this, message));
    var construct = domain.prototype.constructor;
    _this.message = message;
    _this.name = construct.name;
    Error.captureStackTrace(_assertThisInitialized(_this));
    return _this;
  }

  return Exception;
}(_wrapNativeSuper(Error));

module.exports = Exception;
//# sourceMappingURL=index.js.map
