diff --git a/pom.xml b/pom.xml index 8cc0f28..f26f1ff 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.instaclustr commons - 1.4.0 + 1.5.0 Instaclustr commons Common classes and utilities integrated with various projects diff --git a/src/main/java/com/instaclustr/operations/Operation.java b/src/main/java/com/instaclustr/operations/Operation.java index 0adc9eb..c147b71 100644 --- a/src/main/java/com/instaclustr/operations/Operation.java +++ b/src/main/java/com/instaclustr/operations/Operation.java @@ -60,6 +60,8 @@ public static class Error { public String source; public String message; + + @JsonIgnore public Throwable throwable; public Error() { @@ -68,7 +70,13 @@ public Error() { public Error(final Throwable throwable, final String message, final String source) { this.throwable = throwable; - this.message = message; + + if (this.throwable != null && this.throwable.getCause() != null && this.throwable.getCause().getMessage() != null) { + this.message = this.throwable.getCause().getMessage(); + } else { + this.message = message; + } + this.source = source; }