UNPKG

@opra/common

Version:
26 lines (25 loc) 875 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ForbiddenError = void 0; const index_js_1 = require("../../enums/index.js"); const opra_http_error_js_1 = require("../opra-http-error.js"); /** * 403 Forbidden * The client does not have access rights to the content; that is, it is unauthorized, * so the server is refusing to give the requested resource. Unlike 401 Unauthorized, * the client's identity is known to the server. */ class ForbiddenError extends opra_http_error_js_1.OpraHttpError { constructor() { super(...arguments); this.status = index_js_1.HttpStatusCode.FORBIDDEN; } init(issue) { super.init({ message: 'You are not authorized to perform this action', code: 'FORBIDDEN', ...issue, }); } } exports.ForbiddenError = ForbiddenError;