Thorsten Schöning created WICKET-6158:
-----------------------------------------

             Summary: Provide error message for Ajax requests in 
DefaultExceptionMapper
                 Key: WICKET-6158
                 URL: https://issues.apache.org/jira/browse/WICKET-6158
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 7.3.0
            Reporter: Thorsten Schöning


DefaultExceptionMapper.internalMap recognizes if something is an Ajax request 
or not and depending on the current application settings a special error 
handler is returned in case of Ajax. I would like to keep that approach, but 
additionally optionally forward at least some part of the currently available 
exception message with that given handler. The handler in general is capable of 
managing an arbitrary message, that's already used in 
ServletWebRequest.getClientUrl. The problem with the current approach is that's 
it's not easily overridable, because internalMap is private and such.

So I would like to suggest that you either introduce an additional 
AjaxErrorHandlingStrategy like INVOKE_FAILURE_HANDLER_WITH_MSG and provide the 
exception message in that case to the handler or add a protected callback which 
gets the current exception and returns the handler to return in case of Ajax. 
Both approaches make sense to me and would help me a lot in my use case, but I 
guess the protected callback is more flexible in general.

Thanks for consideration!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to