-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement request related to exception handling #101
Comments
Hi The ControllerAdvice/ResponseEntityExceptionHandler looks like a very The second solution looks like easier to implement. We could create an public interface EdsExceptionHandler { and create a default implementation that contains the current exception On Thu, Aug 15, 2013 at 8:54 AM, dilbertside notifications@github.comwrote:
|
answers inline On 08/15/2013 03:34 PM, Ralph Schaer wrote:
|
Then let's try the second solution. Do you want to give it a try or should On Thu, Aug 15, 2013 at 10:07 AM, dilbertside notifications@github.comwrote:
|
If you have some time, I would let you start. Thanks |
I created a new branch (issue101) and made some changes. There is now an interface ch.ralscha.extdirectspring.controller.RouterExceptionHandler and a default implementation ch.ralscha.extdirectspring.controller.DefaultRouterExceptionHandler. Right now the method signature looks like this: I can add additional parameters, like servlet request or Ext.Direct request, if your program requires these. |
Thanks, that's almost perfect :-) What I would suggest is to give the user the possibility to insert his As suggested, I would need also the Ext.Direct request, Principal and On 08/15/2013 07:08 PM, Ralph Schaer wrote:
|
Thanks. Looks good. Integrated your changes in my branch and build a new SNAPSHOT |
I forgot to address the 2 other cases poll and handleMethodCall in I tested it, perfect. Thank you very much |
This breaks a few unit tests because the library does not expect a response On Fri, Aug 16, 2013 at 6:41 AM, dilbertside notifications@github.comwrote:
|
which one poll or handleMethodCall ? Because actually when I proceeded to implement some logic I noticed I can work on the unit test to make them work. |
I like your change that the exception handler can set a result. But this breaks a few unit tests and it could break some code if somebodys program expect a null result. To solve this I added the MethodInfo to the signature of the exception handler method. This way the default exception handler only sends a result back if it's a FORM_POST method call.
|
Hmmm! more tricky than I thought. I'm running some tests on STORE_MODIFY and I noticed So in the current implementation of EDS, it is fine when you return null However, I will file a bug report with them, to ask why the Your latest change didn't break my customized exception handling, so we |
Forget about the extjs bug. I was wrong about the fact that the message Down the line in result = reader.read(me.extractResponseData(response)); in fact in we have something like if (me.messageProperty) { and by default messageProperty is undefined. (same code in 4.1.3 and 4.2.1) So I was wondering if the model generator could add optionally that as Most of my extjs model now are generated with the generator, so it would Should I make a new improvement request issue and would it be a valuable On 08/16/2013 03:38 PM, Ralph Schaer wrote:
|
|
All the changes are now merged into the 'next' branch. |
thanks a lot. |
Hi,
I am facing a problem related to an error thrown like org.springframework.dao.DataIntegrityViolationException when trying to deleting a DB entity.
This error is expected and it is not a big issue or a bug. Why?
Because the Data Model to map the business model, has some constraint to avoid data loss by negligence.
So the client has to go through some steps so the entity could be deleted properly. Other user constraints make it difficult to do it through a proper workflow.
For legal reasons, every single deletion is audit trailed and error occurring have to be stored.
So come to my problem, when EDS catch the error in RouterController.handleException, it by-passes the web app to give a direct answer to the front-end.
EDS gives the opportunity to add some customization through Configuration.setExceptionToMessage but it is too generic and the net is too wide.
I can add DataIntegrityViolationException in the map but it will not help in a case of a business rule break and/or a real bug. It is too coarse.
And to make things bad, we cannot take quick action as the webapp is not aware what went wrong (except through the eventual log).
We would like to track the error and not send a straight notification to the user but a more elaborate answer.
My question is would it be possible to handover exception handling to application logic and not the library logic?
I see at least 2 possible solutions:
remove the try catch in RouterController.router so the error handling centralization can be made as Spring propose with its @ControllerAdvice and ResponseEntityExceptionHandler? cf http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/htmlsingle/#new-in-3.2-webmvc-exception-handler-support
or inject an exception handler in the RouterController so to delegate the exception handling to another bean if any are configured?
Regards,
The text was updated successfully, but these errors were encountered: