Cleanup RuntimeException throws
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / IdentifiableItemCodec.java
index 0b38fef314919ed43728b17dfc7321c94977d600..6c90da7643d54b03ec12412921da7a8801b8c637 100644 (file)
@@ -149,7 +149,7 @@ abstract class IdentifiableItemCodec implements Codec<NodeIdentifierWithPredicat
             identifier = deserializeIdentifier(input.getKeyValues());
         } catch (Throwable e) {
             Throwables.throwIfUnchecked(e);
-            throw new RuntimeException(e);
+            throw new IllegalStateException("Failed to deserialize " + input, e);
         }
 
         return IdentifiableItem.of((Class) identifiable, (Identifier) identifier);
@@ -173,7 +173,7 @@ abstract class IdentifiableItemCodec implements Codec<NodeIdentifierWithPredicat
                 try {
                     return MethodHandles.publicLookup().unreflectConstructor(constr);
                 } catch (IllegalAccessException e) {
-                    throw new IllegalArgumentException("Cannot access constructor " + constr + " in class " + clazz, e);
+                    throw new IllegalStateException("Cannot access constructor " + constr + " in class " + clazz, e);
                 }
             }
         }