Rework body formatting wiring
[netconf.git] / protocol / restconf-api / src / main / java / org / opendaylight / restconf / api / query / WithDefaultsParam.java
index c2a30c62d48e4c94b169822e3efefdf73114a24b..147fada3a80da1a89cc228509738a882d07e4b0c 100644 (file)
@@ -60,7 +60,11 @@ public enum WithDefaultsParam implements RestconfQueryParam<WithDefaultsParam> {
     }
 
     public static @NonNull WithDefaultsParam forUriValue(final String uriValue) {
-        return of(WithDefaultsMode.ofName(uriValue));
+        try {
+            return of(WithDefaultsMode.ofName(uriValue));
+        } catch (IllegalArgumentException e) {
+            throw new IllegalArgumentException("Invalid " + uriName + " value: " + e.getMessage(), e);
+        }
     }
 
     @Override