Closed
Description
Actual Behavior
Upgrading the Java Dapr SDK from 1.11 to 1.12 changed the exception handling behaviour in Http Binding where the errorIfNot2XX flag is set to false.
ie: When service A calls service B and B throws an error:
Dapr SDK 1.11
A gets the error status code (eg 400) and the error response body.
Dapr SDK 1.12
A gets the status code (eg 405) as part of the response body itself and overall http request status is 200.
They are mentioning that they now need to parse the response body manually in order to evaluate whether the call fetched a successful response or an exception.
Here is the code:
Map<String, String> requestMetaData = new HashMap<>();
requestMetaData.put("errorIfNot2XX", "false");
daprClient.invokeBinding(
"fetch-documents-using-group-name",
DaprHttpMethod.POST,
body,
requestMetaData,
Void.class);
mono.block();
Is this a bug or was this change planned? This is likely due to the way the change in the java sdk returning status object and not httpStatusCode .