@naturalcycles/datastore-lib 3.32.0 → 3.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -393,7 +393,13 @@ class DatastoreDBTransaction {
393
393
  this.tx = tx;
394
394
  }
395
395
  async rollback() {
396
- await this.tx.rollback();
396
+ try {
397
+ await this.tx.rollback();
398
+ }
399
+ catch (err) {
400
+ // log the error, but don't re-throw, as this should be a graceful rollback
401
+ this.db.cfg.logger.error(err);
402
+ }
397
403
  }
398
404
  async getByIds(table, ids, opt) {
399
405
  return await this.db.getByIds(table, ids, { ...opt, tx: this });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalcycles/datastore-lib",
3
- "version": "3.32.0",
3
+ "version": "3.32.1",
4
4
  "description": "Opinionated library to work with Google Datastore",
5
5
  "scripts": {
6
6
  "prepare": "husky install"
@@ -564,7 +564,12 @@ export class DatastoreDBTransaction implements DBTransaction {
564
564
  ) {}
565
565
 
566
566
  async rollback(): Promise<void> {
567
- await this.tx.rollback()
567
+ try {
568
+ await this.tx.rollback()
569
+ } catch (err) {
570
+ // log the error, but don't re-throw, as this should be a graceful rollback
571
+ this.db.cfg.logger.error(err)
572
+ }
568
573
  }
569
574
 
570
575
  async getByIds<ROW extends ObjectWithId>(