UNPKG

@opra/common

Version:
24 lines (23 loc) 777 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UnauthorizedError = void 0; const opra_http_error_js_1 = require("../opra-http-error.js"); /** * 401 Unauthorized * Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". * That is, the client must authenticate itself to get the requested response. */ class UnauthorizedError extends opra_http_error_js_1.OpraHttpError { constructor() { super(...arguments); this.status = 401; } init(issue) { super.init({ message: `You don't have permission to perform this action`, code: 'UNAUTHORIZED', ...issue, }); } } exports.UnauthorizedError = UnauthorizedError;