Skip to content

isTransientPersistenceError

isTransientPersistenceError(error): boolean

Defined in: packages/ddd-mikro-orm/src/errors/transient-error.ts:38

Persistence-adapter classifier for driver/network failures that are reasonable to retry. This function is infrastructure-only; application handlers consume TransientOperationError instead of importing this classifier.

An error is transient when its code is one of:

  • a retryable PostgreSQL SQLSTATE: serialization failure 40001, deadlock 40P01, lock not available 55P03, shutdown 57P01–57P03, or any code in the connection-exception (08) or insufficient-resource (53) class;
  • a Node network error: ECONNREFUSED, ECONNRESET, EHOSTUNREACH, ENETUNREACH, EPIPE or ETIMEDOUT;
  • SQLITE_BUSY or SQLITE_LOCKED;

or when its name is TaskCancelledError or TimeoutError. A wrapped error is classified through its cause chain, which may be cyclic.

unknown

boolean