Wrong response code when InterceptorFlowController.invokeRequestHandlers throws an error

32 views
Skip to first unread message

victo...@gmail.com

unread,
Apr 2, 2015, 12:54:03 PM4/2/15
to membrane...@googlegroups.com
Hi, I just found that if InterceptorFlowController.invokeRequestHandlers() throws any exception during processing, e.g. com.fasterxml.jackson.core.JsonParseException, the HTTP response code is set to 200 instead of 400 or 500. Is this by design or a bug?

Thanks...

Thomas Bayer

unread,
Apr 14, 2015, 11:36:39 AM4/14/15
to membrane...@googlegroups.com, victo...@gmail.com
Hi Victor,
think this is an error. I created an issue:


Cheers,
Thomas

Tobias Polley

unread,
Aug 17, 2015, 10:47:21 AM8/17/15
to membrane-monitor, victo...@gmail.com
Hi Victor,

while trying to reproduce this issue, I found that there are two behaviours in master:

1. When an IOException is thrown, no response is produced at all. The incoming TCP connection is simply closed.
2. When any other exception is thrown, the exception is loggend and a HTTP response 500 is returned.

The problem is that JsonParseException extends JsonProcessingException extends IOException. Therefore, instead of a HTTP status code 500, the connection is simply closed in your case.

The reason for behaviour 1 is: If there is an (I/O) problem forwarding a HTTP request, simply close the connection. (As Membrane cannot know whether the request was fully recieved by the next system.)

So where did your JsonParseException come from?

Best, Tobias

PS I'm closing the bug, but we will reopen this one or file another one, when we have more information.
Reply all
Reply to author
Forward
0 new messages