Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignored throwable in Error to break recursivity in go client #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.instaclustr</groupId>
<artifactId>commons</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>

<name>Instaclustr commons</name>
<description>Common classes and utilities integrated with various projects</description>
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/com/instaclustr/operations/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public static class Error {

public String source;
public String message;

@JsonIgnore
public Throwable throwable;

public Error() {
Expand All @@ -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;
}

Expand Down