java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

Exception from Actor's method is not surfaced to the caller

Open amulyavarote opened this issue 1 year ago • 10 comments

Describe the proposal

#Expected Behavior

Exception's error message (not stacktrace) from Actor's method is surfaced to the caller. Add details like exception method, line number, exception type and generate an UUID to match the exceptions both on callee as well as caller side.

UPDATE: Throw an exception with a message in the Actor's method. On the client (ActorProxy), try to call that method. The message from the actor's method should also be in the exception in the client.

UPDATE 2: Dapr's .Net SDK uses "X-DaprErrorResponseHeader" to signify that there is an exception serialized at the body. This implementation should be compatible with .Net SDK (both directions, calling into Actor or being called by the client). I recommend using the 1.12.0-rc.2 version of the runtime to validate this as there is a regression in 1.10 and 1.11 still to be patched.

amulyavarote avatar Sep 06 '22 23:09 amulyavarote

Thanks for this @amulyavarote Could you add more details like the current log and how it looks?

tanvigour avatar Sep 07 '22 21:09 tanvigour

Current logs are quite generic. They should say something like "Actor method invoke exception". We have to add details to this message.

amulyavarote avatar Sep 07 '22 21:09 amulyavarote

Example of exception details: Dapr.Actors.ActorMethodInvocationException: Remote Actor Method Exception, DETAILS: Exception: NotImplementedException, Method Name: ExceptionExample, Line Number: 14, Exception uuid: d291a006-84d5-42c4-b39e-d6300e9ac38b

amulyavarote avatar Sep 13 '22 15:09 amulyavarote

Please refer to .NET SDK for a reference on the solution here.

sicoyle avatar Sep 18 '23 22:09 sicoyle

Dapr's .Net SDK uses "X-DaprErrorResponseHeader" to signify that there is an exception serialized at the body. This implementation should be compatible with .Net SDK (both directions, calling into Actor or being called by the client). I recommend using the 1.12.0-rc.2 version of the runtime to validate this as there is a regression in 1.10 and 1.11 still to be patched.

artursouza avatar Sep 18 '23 22:09 artursouza

/assign

Preeb34 avatar Sep 22 '23 18:09 Preeb34

@Preeb34 Are you working on this? I think the slash in your assign comment needs to be reversed:

/assign

Can you please try it that way and see if it assigns you? Let me know if you need help with anything!

sicoyle avatar Sep 22 '23 19:09 sicoyle

I just updated the comment and sorry about that!

Preeb34 avatar Sep 22 '23 19:09 Preeb34

I just updated the comment and sorry about that!

@Preeb34 Can you create a new comment with /assign for this issue if you are working on it?

mukundansundar avatar Sep 22 '23 20:09 mukundansundar

/assign

Preeb34 avatar Sep 22 '23 20:09 Preeb34