Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1546)

Unified Diff: app/lib/backend.dart

Issue 1842343002: Ignore errors from transaction rollbacks (Closed) Base URL: git@github.com:dart-lang/pub-dartlang-dart.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/lib/backend.dart
diff --git a/app/lib/backend.dart b/app/lib/backend.dart
index 6234b7f0e594fc32a2e08e3081749b1ed77e9fe9..69f204ed5b35b4a7ef69e7914f6a34f87544259b 100644
--- a/app/lib/backend.dart
+++ b/app/lib/backend.dart
@@ -314,7 +314,15 @@ class GCloudPackageRepository extends PackageRepository {
newVersion.pubspec.jsonString);
} catch (error, stack) {
_logger.warning('Error while committing: $error, $stack');
- await T.rollback();
+
+ // This call might fail if the transaction has already been
+ // committed/rolled back or the transaction failed.
+ //
+ // In which case we simply ignore the rollback error and rethrow the
+ // original error.
+ try {
+ await T.rollback();
+ } catch (_) {}
rethrow;
}
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698