diff --git a/lib/objection.js b/lib/objection.js index 062d8e726..5ed2fa8fa 100644 --- a/lib/objection.js +++ b/lib/objection.js @@ -1,6 +1,14 @@ 'use strict'; -const { wrapError, ...DbErrorClasses } = require('db-errors'); +const { + DBError, + UniqueViolationError, + NotNullViolationError, + ForeignKeyViolationError, + ConstraintViolationError, + CheckViolationError, + DataError, +} = require('db-errors'); const { Model: NativeModel } = require('./model/Model'); const { QueryBuilder: NativeQueryBuilder } = require('./queryBuilder/QueryBuilder'); const { QueryBuilderBase } = require('./queryBuilder/QueryBuilderBase'); @@ -88,5 +96,11 @@ module.exports = { knexSnakeCaseMappers, knexIdentifierMapping, - ...DbErrorClasses, + DBError, + UniqueViolationError, + NotNullViolationError, + ForeignKeyViolationError, + ConstraintViolationError, + CheckViolationError, + DataError, };