From 400f7147b9e763c4bb892c3d8694264e9909e6da Mon Sep 17 00:00:00 2001 From: prostgles Date: Tue, 5 Dec 2023 10:36:50 +0200 Subject: [PATCH] improve rollback error --- lib/TableConfig/getFutureTableSchema.ts | 8 +++++--- package-lock.json | 4 ++-- package.json | 2 +- tests/server/package-lock.json | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/TableConfig/getFutureTableSchema.ts b/lib/TableConfig/getFutureTableSchema.ts index b37a88bb..45f7dd34 100644 --- a/lib/TableConfig/getFutureTableSchema.ts +++ b/lib/TableConfig/getFutureTableSchema.ts @@ -49,11 +49,13 @@ export const getFutureTableSchema = async ({ columnDefs, tableName, constraintDe cols = await getTableColumns({ db: t, table: tableName }); /** Rollback */ - return Promise.reject(ROLLBACK); + return Promise.reject(new Error(ROLLBACK)); }); - } catch(e){ - if(e !== ROLLBACK) { + } catch(e: any){ + if(e instanceof Error && e.message === ROLLBACK) { + // Ignore + } else { throw e; } } diff --git a/package-lock.json b/package-lock.json index dcff0fb9..899d7282 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prostgles-server", - "version": "4.1.136", + "version": "4.1.137", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prostgles-server", - "version": "4.1.136", + "version": "4.1.137", "license": "MIT", "dependencies": { "@types/express": "^4.17.13", diff --git a/package.json b/package.json index e926a47a..01a724d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prostgles-server", - "version": "4.1.136", + "version": "4.1.137", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/tests/server/package-lock.json b/tests/server/package-lock.json index d15a3b1f..c9c64923 100644 --- a/tests/server/package-lock.json +++ b/tests/server/package-lock.json @@ -21,7 +21,7 @@ }, "../..": { "name": "prostgles-server", - "version": "4.1.136", + "version": "4.1.137", "license": "MIT", "dependencies": { "@types/express": "^4.17.13",