exceptions.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8. var InvalidInputException = function (_Error) {
  9. _inherits(InvalidInputException, _Error);
  10. function InvalidInputException(symbology, input) {
  11. _classCallCheck(this, InvalidInputException);
  12. var _this = _possibleConstructorReturn(this, (InvalidInputException.__proto__ || Object.getPrototypeOf(InvalidInputException)).call(this));
  13. _this.name = "InvalidInputException";
  14. _this.symbology = symbology;
  15. _this.input = input;
  16. _this.message = '"' + _this.input + '" is not a valid input for ' + _this.symbology;
  17. return _this;
  18. }
  19. return InvalidInputException;
  20. }(Error);
  21. var InvalidElementException = function (_Error2) {
  22. _inherits(InvalidElementException, _Error2);
  23. function InvalidElementException() {
  24. _classCallCheck(this, InvalidElementException);
  25. var _this2 = _possibleConstructorReturn(this, (InvalidElementException.__proto__ || Object.getPrototypeOf(InvalidElementException)).call(this));
  26. _this2.name = "InvalidElementException";
  27. _this2.message = "Not supported type to render on";
  28. return _this2;
  29. }
  30. return InvalidElementException;
  31. }(Error);
  32. var NoElementException = function (_Error3) {
  33. _inherits(NoElementException, _Error3);
  34. function NoElementException() {
  35. _classCallCheck(this, NoElementException);
  36. var _this3 = _possibleConstructorReturn(this, (NoElementException.__proto__ || Object.getPrototypeOf(NoElementException)).call(this));
  37. _this3.name = "NoElementException";
  38. _this3.message = "No element to render on.";
  39. return _this3;
  40. }
  41. return NoElementException;
  42. }(Error);
  43. exports.InvalidInputException = InvalidInputException;
  44. exports.InvalidElementException = InvalidElementException;
  45. exports.NoElementException = NoElementException;