Skip to content

Commit

Permalink
Keep having http payload in exception message.
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
  • Loading branch information
artursouza committed Feb 15, 2024
1 parent 2357205 commit bd0b6c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public void testInvokeException() throws Exception {
assertEquals("UNKNOWN", exception.getErrorCode());
assertNotNull(exception.getMessage());
assertTrue(exception.getMessage().contains("Internal Server Error"));
assertTrue(new String(exception.getPayload()).contains("Internal Server Error"));
}
}
}
2 changes: 1 addition & 1 deletion sdk/src/main/java/io/dapr/client/DaprHttp.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ private static DaprError parseDaprError(byte[] json) {
try {
return DAPR_ERROR_DETAILS_OBJECT_MAPPER.readValue(json, DaprError.class);
} catch (IOException e) {
throw new DaprException("UNKNOWN", "Could not parse error's payload.", json);
throw new DaprException("UNKNOWN", new String(json), json);
}
}

Expand Down

0 comments on commit bd0b6c0

Please sign in to comment.