Skip to content

Commit

Permalink
Adding a customized toString for the errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
rpmoore committed Apr 17, 2014
1 parent f82a841 commit 01449a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ apply plugin: 'maven'

sourceCompatibility = JavaVersion.VERSION_1_7

version = '0.2.2-SNAPSHOT'
version = '0.2.3-SNAPSHOT'
group = 'com.spectralogic'

repositories {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/spectralogic/ds3client/models/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,9 @@ public String getRequestId() {
public void setRequestId(final String requestId) {
this.requestId = requestId;
}

@Override
public String toString() {
return "Status Code (" + code + ") Message: " + message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,14 @@ private static String buildExceptionMessage(final Error error,
error.getMessage()
);
}

@Override
public String toString() {
if(error == null) {
return responseString;
}
else {
return error.toString();
}
}
}

0 comments on commit 01449a1

Please sign in to comment.