You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/03/03 14:01:44 UTC

[jira] Commented: (CAMEL-2519) camel-jetty - When returning an exception then allow to use custom http error code from Exchange.HTTP_RESPONSE_CODE

    [ https://issues.apache.org/activemq/browse/CAMEL-2519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57994#action_57994 ] 

Claus Ibsen commented on CAMEL-2519:
------------------------------------

The only issue I can think of is that if you have a route like this
{code}
from jetty -> to http -> bean process (which throw an exception)
{code}

eg we go a {{to("http://somewhere")}} in the middle. Now that one will populate the headers with the response code from calling the {{somewhere}} server.
And that will most likely be 200, which then fools later when an exception is thrown.

Willem can you add such an unit test, and think how we can fix this?

eg. we are bitten by the problem that Roman also pointed out in a couple of days ago. eg information vs. user set headers.




> camel-jetty - When returning an exception then allow to use custom http error code from Exchange.HTTP_RESPONSE_CODE
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2519
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2519
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-jetty
>    Affects Versions: 2.2.0
>            Reporter: Claus Ibsen
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.3.0
>
>
> By default camel-jetty will use http error code 500. But end user may override and set a specific error code to use instead
> See nabble:
> http://old.nabble.com/Return-exception-message-in-HTTP-body-ts27757151.html
> For example in DSL directly
> {code}
> onException(ValidationException).setHeader(Exchange.HTTP_RESPONSE_CODE, constant(HttpServletResponse.SC_BAD_REQUEST));
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.