relq 1.0.111 → 1.0.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -243,15 +243,26 @@ class RelqBase {
243
243
  }
244
244
  }
245
245
  exports.RelqBase = RelqBase;
246
- const TRANSIENT_CODES = new Set([
246
+ const TRANSIENT_NETWORK_CODES = new Set([
247
247
  'ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND', 'ESERVFAIL',
248
248
  'ETIMEDOUT', 'EPIPE', 'EAI_AGAIN', 'EHOSTUNREACH',
249
249
  'CONNECTION_LOST', 'PROTOCOL_CONNECTION_LOST',
250
250
  ]);
251
+ const TRANSIENT_PG_CODES = new Set([
252
+ '40P01',
253
+ '40001',
254
+ '08006',
255
+ '08001',
256
+ '08004',
257
+ '57P01',
258
+ '57P03',
259
+ ]);
251
260
  function isTransientError(error) {
252
- if (TRANSIENT_CODES.has(error.code))
261
+ if (TRANSIENT_NETWORK_CODES.has(error.code))
262
+ return true;
263
+ if (error.cause && TRANSIENT_NETWORK_CODES.has(error.cause.code))
253
264
  return true;
254
- if (error.cause && TRANSIENT_CODES.has(error.cause.code))
265
+ if (TRANSIENT_PG_CODES.has(error.code))
255
266
  return true;
256
267
  return false;
257
268
  }
@@ -239,15 +239,26 @@ export class RelqBase {
239
239
  return this._isClosed;
240
240
  }
241
241
  }
242
- const TRANSIENT_CODES = new Set([
242
+ const TRANSIENT_NETWORK_CODES = new Set([
243
243
  'ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND', 'ESERVFAIL',
244
244
  'ETIMEDOUT', 'EPIPE', 'EAI_AGAIN', 'EHOSTUNREACH',
245
245
  'CONNECTION_LOST', 'PROTOCOL_CONNECTION_LOST',
246
246
  ]);
247
+ const TRANSIENT_PG_CODES = new Set([
248
+ '40P01',
249
+ '40001',
250
+ '08006',
251
+ '08001',
252
+ '08004',
253
+ '57P01',
254
+ '57P03',
255
+ ]);
247
256
  function isTransientError(error) {
248
- if (TRANSIENT_CODES.has(error.code))
257
+ if (TRANSIENT_NETWORK_CODES.has(error.code))
258
+ return true;
259
+ if (error.cause && TRANSIENT_NETWORK_CODES.has(error.cause.code))
249
260
  return true;
250
- if (error.cause && TRANSIENT_CODES.has(error.cause.code))
261
+ if (TRANSIENT_PG_CODES.has(error.code))
251
262
  return true;
252
263
  return false;
253
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relq",
3
- "version": "1.0.111",
3
+ "version": "1.0.112",
4
4
  "description": "The Fully-Typed PostgreSQL ORM for TypeScript",
5
5
  "author": "Olajide Mathew O. <olajide.mathew@yuniq.solutions>",
6
6
  "license": "MIT",