"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get AuthenticationError () {
        return AuthenticationError;
    },
    get AuthorizationError () {
        return AuthorizationError;
    },
    get BadRequestException () {
        return BadRequestException;
    },
    get ExternalServiceError () {
        return ExternalServiceError;
    },
    get ForbiddenError () {
        return ForbiddenError;
    },
    get InternalServerException () {
        return InternalServerException;
    },
    get NotFoundException () {
        return NotFoundException;
    },
    get NotImplementedException () {
        return NotImplementedException;
    },
    get ValidationException () {
        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