src/app/core/database/pouchdb/database-errors.ts

Description

A write was rejected because the document has changed in the meantime (409).

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 "../../logging/error-classification";

/**
 * The typed errors of the database: converted from PouchDB's and IndexedDB's
 * raw errors by `toTypedDatabaseError` (see `pouchdb-errors.ts`), a write
 * conflict also by the HTTP interceptor.
 */

/** A write was rejected because the document has changed in the meantime (409). */
export class WriteConflictError extends TypedError {
  constructor(message: string, options?: TypedErrorOptions) {
    super("WriteConflictError", "write-conflict", message, options);
  }
}

/** The device's local database (IndexedDB underneath PouchDB) is broken. */
export class LocalStorageError extends TypedError {
  constructor(message: string, options?: TypedErrorOptions) {
    super("LocalStorageError", "local-storage", message, options);
  }
}

results matching ""

    No results matching ""