Issue Type: Task Task
Affects Versions: 1.0.0.CR1
Assignee: Daniel Bevenius
Components: controller
Created: 26/Feb/13 3:23 AM
Description:

The issue was reported by Bruno while working on the TODO app. The issue was that in a Route endpoint a NPE was thrown which was an error in the application and not the controller. But the problem was that the error given was regarding not having a responder for the requested media type, which in this case was "application/json".
What was happening was that the ErrorHandler caught the exception and since there was no error route explicitly defined, the default ErrorRoute was used. The default ErrorRoute produces "text/html". All responses are handled by the same class which is called Responders. The HTTP "Accept" header is specified by the client and is the type of content it wants to receive. But if the route in question is not configured to produce that media type the following exception will be thrown:

@LogMessage(level = Logger.Level.ERROR)
@Message(id = 11, value = "No Responder was found that matched the Accept Header: '%s'. The following Responders are registered: '%s'")
RuntimeException noResponderForRequestedMediaType(String acceptHeader, Responders responders);

This task should enable the accept header from the request to be taken into consideration returning an error response.

As a workaround an error route could be added that produces JSON but it is hard to know the cause of the actual error at the moment which is a borderline bugg.

Fix Versions: 1.0.0.CR1
Project: AeroGear
Priority: Major Major
Reporter: Daniel Bevenius
Security Level: Public (Everyone can see)
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira