summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2017-09-07 12:22:28 +0200
committerMarek Gradzki <mgradzki@cisco.com>2017-09-08 10:09:39 +0200
commit4bb8e498d8b0a95c225c33741d6807315c4320d3 (patch)
treee4bdb2d8001b58a12859aa5e58c743be4820466e
parent712da21827b89b0e809f4f9ffa4da191ad387086 (diff)
Fix Sonar error-handling issues
Change-Id: Iae8a7d27ed4ba778abe5bdbb937f55fa4d7a6638 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/ResourceLoader.java4
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java6
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java6
3 files changed, 8 insertions, 8 deletions
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/ResourceLoader.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/ResourceLoader.java
index c851dab1b..925c58421 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/ResourceLoader.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/ResourceLoader.java
@@ -104,7 +104,7 @@ interface ResourceLoader {
try {
return jar.getInputStream(jarEntry);
} catch (IOException e) {
- throw new IllegalStateException(format("Unable to get stream for entry %s | jar %s", jar, jarEntry));
+ throw new IllegalStateException(format("Unable to get stream for entry %s | jar %s", jar, jarEntry), e);
}
}
@@ -112,7 +112,7 @@ interface ResourceLoader {
try {
return url.toURI();
} catch (URISyntaxException e) {
- throw new IllegalStateException(format("Unable to convert URL %s to URI", url));
+ throw new IllegalStateException(format("Unable to convert URL %s to URI", url), e);
}
}
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java
index fe46410d7..c37353b69 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java
@@ -78,7 +78,7 @@ interface YangDataProcessor {
try {
parentInstanceId = serializer.toBinding(parentYangId);
} catch (DeserializationException e) {
- throw new IllegalArgumentException(String.format("Unable to deserialize %s", parentYangId));
+ throw new IllegalArgumentException(String.format("Unable to deserialize %s", parentYangId), e);
}
if (!parentInstanceId.isPresent()) {
@@ -108,7 +108,7 @@ interface YangDataProcessor {
throw new IllegalArgumentException(String.format("Unable to create node binding for %s|%s", identifier, data));
});
} catch (DeserializationException e) {
- throw new IllegalArgumentException(String.format("Unable to deserialize node %s|%s", identifier, data));
+ throw new IllegalArgumentException(String.format("Unable to deserialize node %s|%s", identifier, data), e);
}
}
@@ -121,7 +121,7 @@ interface YangDataProcessor {
throw new IllegalArgumentException(String.format("Unable convert %s to binding", identifier));
});
} catch (DeserializationException e) {
- throw new IllegalArgumentException(String.format("Unable to deserialize %s", identifier));
+ throw new IllegalArgumentException(String.format("Unable to deserialize %s", identifier), e);
}
}
}
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java
index 216d8353b..efc728cf4 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java
@@ -78,7 +78,7 @@ public interface InjectablesProcessor {
try {
FieldUtils.writeField(field, testInstance, data);
} catch (IllegalAccessException e) {
- throw new IllegalStateException("Unable to access field " + field);
+ throw new IllegalStateException("Unable to access field " + field, e);
}
}
@@ -86,9 +86,9 @@ public interface InjectablesProcessor {
try {
return YangInstanceIdentifier.of(QName.class.cast(type.getField("QNAME").get(null)));
} catch (IllegalAccessException e) {
- throw new IllegalStateException("Constant QNAME not accessible for type" + type);
+ throw new IllegalStateException("Constant QNAME not accessible for type" + type, e);
} catch (NoSuchFieldException e) {
- throw new IllegalStateException("Class " + type + " does not have QName defined");
+ throw new IllegalStateException("Class " + type + " does not have QName defined", e);
}
}