diff --git a/core/lib/Drupal/Core/Routing/MatcherDumper.php b/core/lib/Drupal/Core/Routing/MatcherDumper.php
index 8c91aa2..9e20c30 100644
--- a/core/lib/Drupal/Core/Routing/MatcherDumper.php
+++ b/core/lib/Drupal/Core/Routing/MatcherDumper.php
@@ -119,18 +119,23 @@ public function dump(array $options = array()) {
     // That avoids stale data. The transaction makes it atomic to avoid
     // unstable router states due to random failures.
     $txn = $this->connection->startTransaction();
+    
+    try {
+      $this->connection->delete($this->tableName)
+        ->condition('route_set', $options['route_set'])
+        ->execute();
 
-    $this->connection->delete($this->tableName)
-      ->condition('route_set', $options['route_set'])
-      ->execute();
+      $insert->execute();
 
-    $insert->execute();
-
-    // We want to reuse the dumper for multiple route sets, so on dump, flush
-    // the queued routes.
-    $this->routes = NULL;
-
-    // Transaction ends here.
+      // We want to reuse the dumper for multiple route sets, so on dump, flush
+      // the queued routes.
+      $this->routes = NULL;
+    }
+    catch (\Exception $e) {
+      $transaction->rollback();
+      watchdog_exception('Routing', $e);
+      throw $e;
+    }
   }
 
   /**
