Skip to content

Commit 55071e6

Browse files
committed
fix: error detection
1 parent 1ca3a35 commit 55071e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,8 @@ export class PostgresStorageAdapter implements StorageAdapter {
10141014
await self.createIndexes(className, insertedIndexes, t);
10151015
}
10161016
} catch (e) {
1017-
const columnDoesNotExistError = e.errors && e.errors[0] && e.errors[0].code === '42703';
1017+
// pg-promise use Batch error see https://github.com/vitaly-t/spex/blob/e572030f261be1a8e9341fc6f637e36ad07f5231/src/errors/batch.js#L59
1018+
const columnDoesNotExistError = e.getErrors && e.getErrors()[0] && e.getErrors()[0].code === '42703';
10181019
// Specific case when the column does not exist
10191020
if (columnDoesNotExistError) {
10201021
// If the disableIndexFieldValidation is true, we should ignore the error

0 commit comments

Comments
 (0)