UNPKG

@opra/common

Version:
22 lines (21 loc) 694 B
import { HttpStatusCode } from '../../enums/index.js'; import { OpraHttpError } from '../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. */ export class ForbiddenError extends OpraHttpError { constructor() { super(...arguments); this.status = HttpStatusCode.FORBIDDEN; } init(issue) { super.init({ message: 'You are not authorized to perform this action', code: 'FORBIDDEN', ...issue, }); } }