Skip to content

Commit

Permalink
Clarify UnknownRemoteException message (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkoenig10 authored Jun 23, 2021
1 parent 536a3b4 commit 438f81f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ public String getBody() {
}

public UnknownRemoteException(int status, String body) {
super(String.format("Error %s. (Failed to parse response body as SerializableError.)", status));
super(String.format("Response status: %s", status));
this.status = status;
this.body = body;
}

@Override
public String getLogMessage() {
return "Failed to parse response body as SerializableError.";
return getMessage();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ class UnknownRemoteExceptionTest {
@Test
public void testMessage() {
UnknownRemoteException exception = new UnknownRemoteException(404, "not found");
assertThat(exception.getMessage())
.isEqualTo("Error 404. (Failed to parse response body as SerializableError.)");
assertThat(exception.getLogMessage()).isEqualTo("Failed to parse response body as SerializableError.");
assertThat(exception.getMessage()).isEqualTo("Response status: 404");
assertThat(exception.getLogMessage()).isEqualTo("Response status: 404");
}

@Test
Expand Down

0 comments on commit 438f81f

Please sign in to comment.