UNPKG

@opra/common

Version:
20 lines (19 loc) 595 B
import { OpraHttpError } from '../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. */ export class UnauthorizedError extends OpraHttpError { constructor() { super(...arguments); this.status = 401; } init(issue) { super.init({ message: `You don't have permission to perform this action`, code: 'UNAUTHORIZED', ...issue, }); } }