Skip to content

Commit

Permalink
fix(UnitOfWork): catch transaction rejections
Browse files Browse the repository at this point in the history
  • Loading branch information
RWOverdijk committed Mar 13, 2017
1 parent a3ae73b commit 893416d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UnitOfWork.ts
Expand Up @@ -732,14 +732,14 @@ export class UnitOfWork {
let storeName = store.getName();

if (!this.transactions[storeName]) {
this.transactions[storeName] = new Promise(resolve => {
this.transactions[storeName] = new Promise((resolve, reject) => {
let connection = store.getConnection(Store.ROLE_MASTER);

connection.transaction(transaction => {
this.transactions[storeName] = {connection: connection, transaction: transaction};

resolve(this.transactions[storeName]);
});
}).catch(error => reject(error));
});
}

Expand Down

0 comments on commit 893416d

Please sign in to comment.