dapr / dapr/java-sdk

State management with Java SDK - clarify error message when etag is incorrect

Open
#957 0 comments 0 reactions 0 assignees View on GitHub
needs runtime change
Dominant language
Java
Stars
300
Forks
230
Avg merge
1d 20h
Merged PRs (30d)
4

Description

## Describe the proposal
Currently, when you update the value of a key in the state and do not pass the etag correctly, you receive this generic error message:

```
**io.dapr.exceptions.DaprException: ERR_STATE_SAVE: failed saving state in state store general-purpose-service-store: no item was updated**
at io.dapr.client.DaprHttp$ResponseFutureCallback.onResponse(DaprHttp.java:385) ~[dapr-sdk-1.10.0.jar:na]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ⇢ Handler com.dotmatics.databricksmanagement.api.controller.DbxUserTokenController#createUserToken(RequestUserTokenDto) [DispatcherHandler]
Original Stack Trace:
at io.dapr.client.DaprHttp$ResponseFutureCallback.onResponse(DaprHttp.java:385) ~[dapr-sdk-1.10.0.jar:na]
at org.glowroot.agent.plugin.httpclient.OkHttpCallbackWrapper_.onResponse(OkHttpCallbackWrapper.java:59) ~[na:na]
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) ~[okhttp-4.10.0.jar:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
```

Can you consider returning a clearer and more specific message or error code to facilitate troubleshooting?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.