Comparing version 37.1.0 to 37.2.0
@@ -29,2 +29,5 @@ import { type PrimitiveValueExpression, type Query, type QueryResultRow } from './types'; | ||
} | ||
export declare class BackendTerminatedUnexpectedlyError extends SlonikError { | ||
constructor(error: Error); | ||
} | ||
export declare class BackendTerminatedError extends SlonikError { | ||
@@ -31,0 +34,0 @@ constructor(error: Error); |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CheckIntegrityConstraintViolationError = exports.UniqueIntegrityConstraintViolationError = exports.ForeignKeyIntegrityConstraintViolationError = exports.NotNullIntegrityConstraintViolationError = exports.IntegrityConstraintViolationError = exports.SchemaValidationError = exports.DataIntegrityError = exports.NotFoundError = exports.TupleMovedToAnotherPartitionError = exports.BackendTerminatedError = exports.StatementTimeoutError = exports.StatementCancelledError = exports.ConnectionError = exports.UnexpectedStateError = exports.InputSyntaxError = exports.InvalidInputError = exports.InvalidConfigurationError = exports.SlonikError = void 0; | ||
exports.CheckIntegrityConstraintViolationError = exports.UniqueIntegrityConstraintViolationError = exports.ForeignKeyIntegrityConstraintViolationError = exports.NotNullIntegrityConstraintViolationError = exports.IntegrityConstraintViolationError = exports.SchemaValidationError = exports.DataIntegrityError = exports.NotFoundError = exports.TupleMovedToAnotherPartitionError = exports.BackendTerminatedError = exports.BackendTerminatedUnexpectedlyError = exports.StatementTimeoutError = exports.StatementCancelledError = exports.ConnectionError = exports.UnexpectedStateError = exports.InputSyntaxError = exports.InvalidInputError = exports.InvalidConfigurationError = exports.SlonikError = void 0; | ||
const es6_error_1 = __importDefault(require("es6-error")); | ||
@@ -52,2 +52,8 @@ class SlonikError extends es6_error_1.default { | ||
exports.StatementTimeoutError = StatementTimeoutError; | ||
class BackendTerminatedUnexpectedlyError extends SlonikError { | ||
constructor(error) { | ||
super('Backend has been terminated unexpectedly.', { cause: error }); | ||
} | ||
} | ||
exports.BackendTerminatedUnexpectedlyError = BackendTerminatedUnexpectedlyError; | ||
class BackendTerminatedError extends SlonikError { | ||
@@ -54,0 +60,0 @@ constructor(error) { |
@@ -38,3 +38,3 @@ /// <reference types="node" /> | ||
}; | ||
export { BackendTerminatedError, CheckIntegrityConstraintViolationError, ConnectionError, DataIntegrityError, ForeignKeyIntegrityConstraintViolationError, InputSyntaxError, IntegrityConstraintViolationError, InvalidConfigurationError, InvalidInputError, NotFoundError, NotNullIntegrityConstraintViolationError, SchemaValidationError, SlonikError, StatementCancelledError, StatementTimeoutError, TupleMovedToAnotherPartitionError, UnexpectedStateError, UniqueIntegrityConstraintViolationError, } from './errors'; | ||
export { BackendTerminatedError, BackendTerminatedUnexpectedlyError, CheckIntegrityConstraintViolationError, ConnectionError, DataIntegrityError, ForeignKeyIntegrityConstraintViolationError, InputSyntaxError, IntegrityConstraintViolationError, InvalidConfigurationError, InvalidInputError, NotFoundError, NotNullIntegrityConstraintViolationError, SchemaValidationError, SlonikError, StatementCancelledError, StatementTimeoutError, TupleMovedToAnotherPartitionError, UnexpectedStateError, UniqueIntegrityConstraintViolationError, } from './errors'; | ||
export { createMockPool } from './factories/createMockPool'; | ||
@@ -41,0 +41,0 @@ export { createMockQueryResult } from './factories/createMockQueryResult'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.stringifyDsn = exports.parseDsn = exports.isSqlToken = exports.createTimestampWithTimeZoneTypeParser = exports.createTimestampTypeParser = exports.createNumericTypeParser = exports.createIntervalTypeParser = exports.createDateTypeParser = exports.createBigintTypeParser = exports.createTypeParserPreset = exports.createSqlTokenSqlFragment = exports.createSqlTag = exports.createPool = exports.createMockQueryResult = exports.createMockPool = exports.UniqueIntegrityConstraintViolationError = exports.UnexpectedStateError = exports.TupleMovedToAnotherPartitionError = exports.StatementTimeoutError = exports.StatementCancelledError = exports.SlonikError = exports.SchemaValidationError = exports.NotNullIntegrityConstraintViolationError = exports.NotFoundError = exports.InvalidInputError = exports.InvalidConfigurationError = exports.IntegrityConstraintViolationError = exports.InputSyntaxError = exports.ForeignKeyIntegrityConstraintViolationError = exports.DataIntegrityError = exports.ConnectionError = exports.CheckIntegrityConstraintViolationError = exports.BackendTerminatedError = exports.sql = void 0; | ||
exports.stringifyDsn = exports.parseDsn = exports.isSqlToken = exports.createTimestampWithTimeZoneTypeParser = exports.createTimestampTypeParser = exports.createNumericTypeParser = exports.createIntervalTypeParser = exports.createDateTypeParser = exports.createBigintTypeParser = exports.createTypeParserPreset = exports.createSqlTokenSqlFragment = exports.createSqlTag = exports.createPool = exports.createMockQueryResult = exports.createMockPool = exports.UniqueIntegrityConstraintViolationError = exports.UnexpectedStateError = exports.TupleMovedToAnotherPartitionError = exports.StatementTimeoutError = exports.StatementCancelledError = exports.SlonikError = exports.SchemaValidationError = exports.NotNullIntegrityConstraintViolationError = exports.NotFoundError = exports.InvalidInputError = exports.InvalidConfigurationError = exports.IntegrityConstraintViolationError = exports.InputSyntaxError = exports.ForeignKeyIntegrityConstraintViolationError = exports.DataIntegrityError = exports.ConnectionError = exports.CheckIntegrityConstraintViolationError = exports.BackendTerminatedUnexpectedlyError = exports.BackendTerminatedError = exports.sql = void 0; | ||
const createSqlTag_1 = require("./factories/createSqlTag"); | ||
@@ -8,2 +8,3 @@ exports.sql = (0, createSqlTag_1.createSqlTag)(); | ||
Object.defineProperty(exports, "BackendTerminatedError", { enumerable: true, get: function () { return errors_1.BackendTerminatedError; } }); | ||
Object.defineProperty(exports, "BackendTerminatedUnexpectedlyError", { enumerable: true, get: function () { return errors_1.BackendTerminatedUnexpectedlyError; } }); | ||
Object.defineProperty(exports, "CheckIntegrityConstraintViolationError", { enumerable: true, get: function () { return errors_1.CheckIntegrityConstraintViolationError; } }); | ||
@@ -10,0 +11,0 @@ Object.defineProperty(exports, "ConnectionError", { enumerable: true, get: function () { return errors_1.ConnectionError; } }); |
@@ -146,2 +146,5 @@ "use strict"; | ||
}, 'execution routine produced an error'); | ||
if (error.message === 'Connection terminated unexpectedly') { | ||
throw new errors_1.BackendTerminatedUnexpectedlyError(error); | ||
} | ||
// 'Connection terminated' refers to node-postgres error. | ||
@@ -148,0 +151,0 @@ // @see https://github.com/brianc/node-postgres/blob/eb076db5d47a29c19d3212feac26cd7b6d257a95/lib/client.js#L199 |
@@ -18,3 +18,3 @@ { | ||
"postgres-interval": "^4.0.1", | ||
"roarr": "^7.15.1", | ||
"roarr": "^7.18.3", | ||
"safe-stable-stringify": "^2.4.3", | ||
@@ -36,2 +36,3 @@ "serialize-error": "^8.0.0" | ||
"expect-type": "^0.15.0", | ||
"get-port": "^5.1.1", | ||
"gitdown": "^3.1.5", | ||
@@ -103,3 +104,3 @@ "husky": "^8.0.3", | ||
"types": "./dist/index.d.ts", | ||
"version": "37.1.0" | ||
"version": "37.2.0" | ||
} |
@@ -56,2 +56,8 @@ import { | ||
export class BackendTerminatedUnexpectedlyError extends SlonikError { | ||
public constructor(error: Error) { | ||
super('Backend has been terminated unexpectedly.', { cause: error }); | ||
} | ||
} | ||
export class BackendTerminatedError extends SlonikError { | ||
@@ -58,0 +64,0 @@ public constructor(error: Error) { |
@@ -7,2 +7,3 @@ import { createSqlTag } from './factories/createSqlTag'; | ||
BackendTerminatedError, | ||
BackendTerminatedUnexpectedlyError, | ||
CheckIntegrityConstraintViolationError, | ||
@@ -9,0 +10,0 @@ ConnectionError, |
import { TRANSACTION_ROLLBACK_ERROR_PREFIX } from '../constants'; | ||
import { | ||
BackendTerminatedError, | ||
BackendTerminatedUnexpectedlyError, | ||
CheckIntegrityConstraintViolationError, | ||
@@ -273,2 +274,5 @@ ForeignKeyIntegrityConstraintViolationError, | ||
); | ||
if (error.message === 'Connection terminated unexpectedly') { | ||
throw new BackendTerminatedUnexpectedlyError(error); | ||
} | ||
@@ -275,0 +279,0 @@ // 'Connection terminated' refers to node-postgres error. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
509534
7448
24
Updatedroarr@^7.18.3