UNPKG

@fdm-monster/server

Version:

FDM Monster is a bulk OctoPrint manager to set up, configure and monitor 3D printers. Our aim is to provide extremely optimized websocket performance and reliability.

112 lines (111 loc) 2.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { AuthenticationError: function() { return AuthenticationError; }, AuthorizationError: function() { return AuthorizationError; }, BadRequestException: function() { return BadRequestException; }, ExternalServiceError: function() { return ExternalServiceError; }, ForbiddenError: function() { return ForbiddenError; }, InternalServerException: function() { return InternalServerException; }, NotFoundException: function() { return NotFoundException; }, NotImplementedException: function() { return NotImplementedException; }, ValidationException: function() { return ValidationException; } }); class NotImplementedException extends Error { constructor(message){ super(message); this.name = NotImplementedException.name; } } class AuthenticationError extends Error { reasonCode; constructor(error, reasonCode = ""){ super(error); this.name = AuthenticationError.name; this.reasonCode = reasonCode; } } class ForbiddenError extends Error { constructor(error){ super(error); this.name = ForbiddenError.name; } } class AuthorizationError extends Error { permissions = []; roles = []; reason; constructor({ permissions, roles, reason }){ super("Authorization failed"); this.name = AuthorizationError.name; this.reason = reason; this.permissions = permissions; this.roles = roles; } } class BadRequestException extends Error { constructor(message){ super(message); this.name = BadRequestException.name; } } class NotFoundException extends Error { path; constructor(message, path){ super(message); this.name = NotFoundException.name; this.path = path; } } class ValidationException extends Error { errors; constructor(validationObject){ super(JSON.stringify(validationObject)); this.name = ValidationException.name; this.errors = validationObject; } } class ExternalServiceError extends Error { error; serviceType; constructor(responseObject, serviceType){ super(JSON.stringify(responseObject)); this.name = ExternalServiceError.name; this.error = responseObject; this.serviceType = serviceType; } } class InternalServerException extends Error { constructor(message, stack){ super(message); this.name = InternalServerException.name; this.stack = stack; } } //# sourceMappingURL=runtime.exceptions.js.map