Skip to content

Commit

Permalink
improve rollback error
Browse files Browse the repository at this point in the history
  • Loading branch information
prostgles committed Dec 5, 2023
1 parent 02967dc commit 400f714
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions lib/TableConfig/getFutureTableSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 400f714

Please sign in to comment.