You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the dapr runtime returned error details to the Java DaprException (#998)
* properly add the dapr runtime returned error details to the Java DaprException
Signed-off-by: Cassandra Coyle <[email protected]>
* add error handling to sdk docs
Signed-off-by: Cassandra Coyle <[email protected]>
* add tests for the dapr exception changes
Signed-off-by: Cassandra Coyle <[email protected]>
* try verifyNoMoreInteractions w/ channel
Signed-off-by: Cassandra Coyle <[email protected]>
* verify channel close -> channel close explicitly
Signed-off-by: Cassandra Coyle <[email protected]>
* rm verifyNoMoreInteractions
Signed-off-by: Cassandra Coyle <[email protected]>
* rm test to see if that is the orphaned managed channel issue
Signed-off-by: Cassandra Coyle <[email protected]>
* re-add test since that doesnt seem to be the issue
Signed-off-by: Cassandra Coyle <[email protected]>
* channel.close(); -> verify(channel).close();
Signed-off-by: Cassandra Coyle <[email protected]>
* Rewrite and redesign of the DaprErrorDetail in DaprException.
Signed-off-by: Artur Souza <[email protected]>
* Update daprdocs too for DaprErrorDetails.
Signed-off-by: Artur Souza <[email protected]>
* Fix README.md mm string.
Signed-off-by: Artur Souza <[email protected]>
* Fix exception example.
Signed-off-by: Artur Souza <[email protected]>
* Use runtime 1.13.0-rc.2
Signed-off-by: Artur Souza <[email protected]>
* Fix exception example to match gRPC output.
Signed-off-by: Artur Souza <[email protected]>
* Update error message in IT as per new Dapr runtime version.
Signed-off-by: Artur Souza <[email protected]>
* Dapr 1.13 is less tolerant of app downtime to keep timers.
Signed-off-by: Artur Souza <[email protected]>
---------
Signed-off-by: Cassandra Coyle <[email protected]>
Signed-off-by: Artur Souza <[email protected]>
Co-authored-by: Artur Souza <[email protected]>
Co-authored-by: Artur Souza <[email protected]>
Copy file name to clipboardexpand all lines: examples/src/main/java/io/dapr/examples/exception/README.md
+30-44
Original file line number
Diff line number
Diff line change
@@ -23,52 +23,49 @@ cd java-sdk
23
23
Then build the Maven project:
24
24
25
25
```sh
26
-
# make sure you are in the `java-sdk` directory.
27
-
mvn install
26
+
# make sure you are in the `java-sdk` (root) directory.
27
+
./mvnw clean install
28
28
```
29
29
30
30
Then get into the examples directory:
31
31
```sh
32
32
cd examples
33
33
```
34
34
35
-
### Running the StateClient
36
-
This example uses the Java SDK Dapr client in order to perform an invalid operation, causing Dapr runtime to return an error. See the code snippet below:
35
+
### Understanding the code
36
+
37
+
This example uses the Java SDK Dapr client in order to perform an invalid operation, causing Dapr runtime to return an error. See the code snippet below, from `Client.java`:
The code uses the `DaprClient` created by the `DaprClientBuilder`. It tries to get a state from state store, but provides an unknown state store. It causes the Dapr sidecar to return an error, which is converted to a `DaprException` to the application. To be compatible with Project Reactor, `DaprException` extends from `RuntimeException` - making it an unchecked exception. Applications might also get an `IllegalArgumentException` when invoking methods with invalid input parameters that are validated at the client side.
60
-
61
-
The Dapr client is also within a try-with-resource block to properly close the client at the end.
62
60
63
61
### Running the example
64
62
65
-
Run this example with the following command:
66
-
67
63
<!-- STEP
68
64
name: Run exception example
69
65
expected_stdout_lines:
70
66
- '== APP == Error code: INVALID_ARGUMENT'
71
-
- '== APP == Error message: INVALID_ARGUMENT: state store Unknown state store is not found'
67
+
- '== APP == Error message: INVALID_ARGUMENT: pubsub unknown_pubsub is not found'
0 commit comments