src/app/core/permissions/not-permitted.error.ts

Description

The permission rules do not allow the current user what was requested: our backend answered 403, or 401 "not permitted" (converted by the database layer and the HTTP interceptor, see backend-response.ts), or any 401 to a session without login (e.g. a public form, see RemotePouchDatabase).

Extends

TypedError

Relationships

Used by

No results matching.

Depends on

Index

Properties

Constructor

constructor(message: string, options?: TypedErrorOptions)
Parameters :
Name Type Optional
message string No
options TypedErrorOptions Yes

Properties

Readonly classification
Type : ErrorClassification
Inherited from TypedError

The kind of failure: an own property, so that a copy of the error that lost its class (as PouchDB's createError() makes) still has it.

Readonly Optional status
Type : number
Inherited from TypedError

The HTTP status of the failed request, if any.

Readonly Optional details
Type : Record<string, unknown>
Inherited from NamedError

Context for the report, kept out of the message so that it does not split the issue.

import {
  TypedError,
  TypedErrorOptions,
} from "#src/app/core/logging/error-classification";

/**
 * The permission rules do not allow the current user what was requested: our
 * backend answered 403, or 401 "not permitted" (converted by the database layer
 * and the HTTP interceptor, see `backend-response.ts`), or any 401 to a session
 * without login (e.g. a public form, see `RemotePouchDatabase`).
 */
export class NotPermittedError extends TypedError {
  constructor(message: string, options?: TypedErrorOptions) {
    super("NotPermittedError", "not-permitted", message, options);
  }
}

results matching ""

    No results matching ""