exceptions.js 674 B

1234567891011121314151617181920212223242526272829
  1. class InvalidInputException extends Error{
  2. constructor(symbology, input) {
  3. super();
  4. this.name = "InvalidInputException";
  5. this.symbology = symbology;
  6. this.input = input;
  7. this.message = '"' + this.input + '" is not a valid input for ' + this.symbology;
  8. }
  9. }
  10. class InvalidElementException extends Error{
  11. constructor() {
  12. super();
  13. this.name = "InvalidElementException";
  14. this.message = "Not supported type to render on";
  15. }
  16. }
  17. class NoElementException extends Error{
  18. constructor() {
  19. super();
  20. this.name = "NoElementException";
  21. this.message = "No element to render on.";
  22. }
  23. }
  24. export {InvalidInputException, InvalidElementException, NoElementException};