UNPKG

@opra/common

Version:
17 lines (16 loc) 531 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 { status = 401; init(issue) { super.init({ message: `You don't have permission to perform this action`, code: 'UNAUTHORIZED', ...issue, }); } }