Catch a specific exception, not generic Exception
Change-Id: I7e087de452e093b2d7bc3d098847d51b4dff9460
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -102,7 +102,7 @@ public class ConsistentResourceStore implements ResourceStore { | ... | @@ -102,7 +102,7 @@ public class ConsistentResourceStore implements ResourceStore { |
102 | } | 102 | } |
103 | tx.commit(); | 103 | tx.commit(); |
104 | return true; | 104 | return true; |
105 | - } catch (Exception e) { | 105 | + } catch (TransactionException e) { |
106 | log.error("Exception thrown, abort the transaction", e); | 106 | log.error("Exception thrown, abort the transaction", e); |
107 | tx.abort(); | 107 | tx.abort(); |
108 | return false; | 108 | return false; | ... | ... |
-
Please register or login to post a comment