Improve ActionException's for the Rest Dispatcher#735
Improve ActionException's for the Rest Dispatcher#735BenDol wants to merge 5 commits intoArcBees:masterfrom
Conversation
…ails. This gives better understanding to what has gone wrong during transport.
|
Added an example to the carstore sample application ArcBees/GWTP-Samples#91 |
|
I'm not sure I can see the need to have both Imo the action instance should be available through the deserialization as well. |
There was a problem hiding this comment.
I don't see the use of this overload
Passing the Response in deserializeValue in order to provide information in the exception.
|
Well a response exception is when there is a response problem not a deserialization problem, so if the server returns an unsuccessful status code it throws the ActionResponseException with the response information. The deserialization exception extends the response exception because its part of the response phase and has response information. |
|
This allows me to catch response specific errors and handle them in my exception handler. I.e. security exceptions where I notify the user of insufficient rights. |
|
Is this PR going to be used or reviewed to be used? Would be helpful for me. |
|
Going to be reviewed, sorry about this! |
|
It would be interesting to have Also, in
Can we get rid of the "Action" prefix. This may cause clashes with other exception names, though those prefixes annoy me to no end and I'm trying to get rid of them as time goes on ;) |
|
@BenDol can we help you with that PR ? |
|
Hey Chris, since this PR is not going to be merged can you help me understand how the new exception handling should work? I currently use this for catching my exceptions in my latest project and would need to rewrite it to work the way you have redesigned it. Thanks! |
This gives better understanding of issues during transport.
Exception Hierarchy:
|-- Exception
-- ActionException -- RestActionException|-- ActionResponseException
|
-- ActionDeserializationException -- ActionSerializationExceptionActionException.java
This exception now takes a
TypedAction<?>(which has been madeSerializable).Note: There have been issues with variables in Exceptions for the RPC implementation, will need to know what the limitations are if there are any.
RestActionException.java
Used as convenience for type casting the
TypedAction<?>directly asRestAction<?>. Extends theActionExceptionclass.ActionResponseException.java
Used in the response phase providing most of the
Responseinformation in the exception.ActionDeserializationExceptionextends this class.ActionSerializationException.java
Used in the serialization of an action request, mostly when a SerializationException is thrown.
ActionDeserializationException.java
Used during the deserialization of a response from the server, only thrown when the response is unable to be deserialized by the object mapper. This class extends
ActionResponseExceptionproviding theResponseinformation with it.