Merge "Clean up netconf-parent root pom"
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / QueryParametersParser.java
index f1b50285c13041f265ad49a91adefd2a9ca0962a..7e878591a1fa791fe821f9864d43c0df4eb70188 100644 (file)
@@ -10,8 +10,10 @@ package org.opendaylight.netconf.sal.restconf.impl;
 import com.google.common.base.Strings;
 import javax.ws.rs.core.UriInfo;
 import org.opendaylight.restconf.common.context.WriterParameters;
+import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
+import org.opendaylight.restconf.common.errors.RestconfError;
 
-public class QueryParametersParser {
+public final class QueryParametersParser {
 
     private enum UriParameters {
         PRETTY_PRINT("prettyPrint"),
@@ -29,6 +31,10 @@ public class QueryParametersParser {
         }
     }
 
+    private QueryParametersParser() {
+
+    }
+
     public static WriterParameters parseWriterParameters(final UriInfo info) {
         return parseParams(info, false);
     }
@@ -56,7 +62,7 @@ public class QueryParametersParser {
                 }
                 wpBuilder.setDepth(depth);
             } catch (final NumberFormatException e) {
-                throw new RestconfDocumentedException(new RestconfError(
+                throw new RestconfDocumentedException(e, new RestconfError(
                         RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.INVALID_VALUE,
                         "Invalid depth parameter: " + e.getMessage(), null,
                         "The depth parameter must be an integer > 1 or \"unbounded\""));