Skip to content

Commit 01449a1

Browse files
committed
Adding a customized toString for the errors.
1 parent f82a841 commit 01449a1

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ apply plugin: 'maven'
1818

1919
sourceCompatibility = JavaVersion.VERSION_1_7
2020

21-
version = '0.2.2-SNAPSHOT'
21+
version = '0.2.3-SNAPSHOT'
2222
group = 'com.spectralogic'
2323

2424
repositories {

src/main/java/com/spectralogic/ds3client/models/Error.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,9 @@ public String getRequestId() {
5656
public void setRequestId(final String requestId) {
5757
this.requestId = requestId;
5858
}
59+
60+
@Override
61+
public String toString() {
62+
return "Status Code (" + code + ") Message: " + message;
63+
}
5964
}

src/main/java/com/spectralogic/ds3client/networking/FailedRequestException.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,14 @@ private static String buildExceptionMessage(final Error error,
6666
error.getMessage()
6767
);
6868
}
69+
70+
@Override
71+
public String toString() {
72+
if(error == null) {
73+
return responseString;
74+
}
75+
else {
76+
return error.toString();
77+
}
78+
}
6979
}

0 commit comments

Comments
 (0)