export class HttpError extends Error {
    status;
    message;
    title;
    constructor(status, message, title) {
        super(message);
        this.status = status;
        this.message = message;
        this.title = title;
    }
}
export class BadRequestError extends HttpError {
    constructor(message) {
        super(400, message, 'Bad request');
    }
}
// We should use UnauthorizedError defined in packages/server
export class UnauthorizedError extends HttpError {
    constructor(message) {
        super(401, message, 'Unauthorized');
    }
}
export class ForbiddenError extends HttpError {
    constructor(message = 'You do not have permission to perform this action.') {
        super(403, message, 'Forbidden');
    }
}
export class NotFoundError extends HttpError {
    constructor(message) {
        super(404, message || 'Resource not found', 'Not found');
    }
}
export class RequestTimedOut extends HttpError {
    constructor(message) {
        super(408, message || 'Request timed out', 'Request timeout');
    }
}
export class InternalServerError extends HttpError {
    constructor(message) {
        super(500, message || 'Internal server error', 'Internal server error');
    }
}
export class NotImplementedError extends HttpError {
    constructor(message) {
        super(501, message, 'Not implemented');
    }
}
export class BadGatewayError extends HttpError {
    constructor(message) {
        super(502, message, 'Bad gateway');
    }
}
export class TooManyRequestsError extends HttpError {
    constructor(message) {
        super(429, message, 'Too many requests');
    }
}
// to differenciate from other UnauthorizedError returned from agent
export class RbacUnauthorizedError extends UnauthorizedError {
    constructor(message) {
        super(message);
    }
}
export class ConflictError extends HttpError {
    constructor(message) {
        super(409, message, 'Conflict occurred.');
    }
}
export class MethodNotAllowedError extends HttpError {
    constructor(message) {
        super(405, message || 'Method Not Allowed', 'Method Not Allowed');
    }
}
export class UnprocessableContentError extends HttpError {
    constructor(message) {
        super(422, message || 'Unprocessable Content', 'Unprocessable Content');
    }
}
export class FailedDependencyError extends HttpError {
    constructor(message) {
        super(424, message, 'Failed Dependency');
    }
}
export class ServiceUnavailableError extends HttpError {
    constructor(message) {
        super(503, message || 'Service Unavailable', 'Service Unavailable');
    }
}
export const NON_SB_ORG_UPDATE_ERROR = 'Superblocks user cannot update non-Superblocks organization without explicit flag.';
//# sourceMappingURL=http.js.map