|
From: Martin A. <sp...@ma...> - 2008-07-08 09:52:58
|
In ResourceMethod.invoke() line 153, there's a try-catch that makes all Failure exceptions thrown below be translated to 400. Is this deliberate? To make NumberFormatException result in 404 I want to pass my error code in the Failure exception, and then get that set in the response. I've checked in a change where we always set the error code passed in the Failure - it looks reasonable. Martin |
|
From: Ryan J. M. <ry...@da...> - 2008-07-08 11:11:17
|
Martin, This sounds similar to the issue I logged: http://jira.jboss.com/jira/browse/RESTEASY-63 The TestIIOImageProvider.testPostUnsupportedImage() should get a 406 response with a list of variants rather than a 400. The correct assertion is currently commented out on line 109. So in addition to the response code, we also need to include the response information generated from a WebApplicationException as well. If you're in there, please have a take a look. Ryan- On Jul 8, 2008, at 5:52 AM, Martin Algesten wrote: > > In ResourceMethod.invoke() line 153, there's a try-catch that makes > all Failure exceptions thrown below be translated to 400. Is this > deliberate? To make NumberFormatException result in 404 I want to pass > my error code in the Failure exception, and then get that set in the > response. > > I've checked in a change where we always set the error code passed in > the Failure - it looks reasonable. > > Martin > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers |
|
From: Martin A. <sp...@ma...> - 2008-07-08 11:22:16
|
I'll look at that. M On 8 Jul 2008, at 13:11, Ryan J. McDonough wrote: > Martin, > > This sounds similar to the issue I logged: > > http://jira.jboss.com/jira/browse/RESTEASY-63 > > The TestIIOImageProvider.testPostUnsupportedImage() should get a 406 > response with a list of variants rather than a 400. The correct > assertion is currently commented out on line 109. So in addition to > the response code, we also need to include the response information > generated from a WebApplicationException as well. If you're in > there, please have a take a look. > > Ryan- > > > > On Jul 8, 2008, at 5:52 AM, Martin Algesten wrote: > >> >> In ResourceMethod.invoke() line 153, there's a try-catch that makes >> all Failure exceptions thrown below be translated to 400. Is this >> deliberate? To make NumberFormatException result in 404 I want to >> pass >> my error code in the Failure exception, and then get that set in the >> response. >> >> I've checked in a change where we always set the error code passed in >> the Failure - it looks reasonable. >> >> Martin >> >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic >> lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > |
|
From: Bill B. <bb...@re...> - 2008-07-08 12:18:31
|
Change the code to check for Failure (if it doesn't already) and rethrow that. Martin Algesten wrote: > In ResourceMethod.invoke() line 153, there's a try-catch that makes > all Failure exceptions thrown below be translated to 400. Is this > deliberate? To make NumberFormatException result in 404 I want to pass > my error code in the Failure exception, and then get that set in the > response. > > I've checked in a change where we always set the error code passed in > the Failure - it looks reasonable. > > Martin > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2008-07-08 12:30:47
|
Would be cool to have a regression unit test that duplicates the problems you and ryan are seeing too. Bill Burke wrote: > Change the code to check for Failure (if it doesn't already) and rethrow > that. > > Martin Algesten wrote: >> In ResourceMethod.invoke() line 153, there's a try-catch that makes >> all Failure exceptions thrown below be translated to 400. Is this >> deliberate? To make NumberFormatException result in 404 I want to pass >> my error code in the Failure exception, and then get that set in the >> response. >> >> I've checked in a change where we always set the error code passed in >> the Failure - it looks reasonable. >> >> Martin >> >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bill B. <bb...@re...> - 2008-07-08 22:33:01
|
Martin, couple problems with your commit: 1) You broke other tests that depended on 400. Please run whole testsuite next time, thanks. 2) I believe, after looking at those broken tests, that I ported the test from Jersey's testsuite. This means that we might have to change the behavior back to the way it was. We'll see what happens with the TCK. Bill Burke wrote: > Would be cool to have a regression unit test that duplicates the > problems you and ryan are seeing too. > > Bill Burke wrote: >> Change the code to check for Failure (if it doesn't already) and rethrow >> that. >> >> Martin Algesten wrote: >>> In ResourceMethod.invoke() line 153, there's a try-catch that makes >>> all Failure exceptions thrown below be translated to 400. Is this >>> deliberate? To make NumberFormatException result in 404 I want to pass >>> my error code in the Failure exception, and then get that set in the >>> response. >>> >>> I've checked in a change where we always set the error code passed in >>> the Failure - it looks reasonable. >>> >>> Martin >>> >>> >>> ------------------------------------------------------------------------- >>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >>> Studies have shown that voting for your favorite open source project, >>> along with a healthy diet, reduces your potential for chronic lameness >>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >>> _______________________________________________ >>> Resteasy-developers mailing list >>> Res...@li... >>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Martin A. <sp...@ma...> - 2008-07-08 15:30:31
|
Just checked in a fix for RESTEASY-63 together with two test cases that ensure that MessageBodyReader and MessageBodyWriter can both throw WebApplicationException with response codes through to the HttpServletResponse. This fixes RESTEASY-63 - I re-enabled Ryan's proper check. M On 8 Jul 2008, at 14:33, Bill Burke wrote: > Would be cool to have a regression unit test that duplicates the > problems you and ryan are seeing too. > > Bill Burke wrote: >> Change the code to check for Failure (if it doesn't already) and >> rethrow that. >> Martin Algesten wrote: >>> In ResourceMethod.invoke() line 153, there's a try-catch that >>> makes all Failure exceptions thrown below be translated to 400. >>> Is this deliberate? To make NumberFormatException result in 404 I >>> want to pass my error code in the Failure exception, and then get >>> that set in the response. >>> >>> I've checked in a change where we always set the error code passed >>> in the Failure - it looks reasonable. >>> >>> Martin >>> |
|
From: Martin A. <sp...@ma...> - 2008-07-08 15:35:06
|
Can't close the JIRA bug though :/ On 8 Jul 2008, at 17:30, Martin Algesten wrote: > > Just checked in a fix for RESTEASY-63 together with two test cases > that ensure that MessageBodyReader and MessageBodyWriter can both > throw WebApplicationException with response codes through to the > HttpServletResponse. > > This fixes RESTEASY-63 - I re-enabled Ryan's proper check. > > M > > On 8 Jul 2008, at 14:33, Bill Burke wrote: > >> Would be cool to have a regression unit test that duplicates the >> problems you and ryan are seeing too. >> >> Bill Burke wrote: >>> Change the code to check for Failure (if it doesn't already) and >>> rethrow that. >>> Martin Algesten wrote: >>>> In ResourceMethod.invoke() line 153, there's a try-catch that >>>> makes all Failure exceptions thrown below be translated to 400. >>>> Is this deliberate? To make NumberFormatException result in 404 I >>>> want to pass my error code in the Failure exception, and then get >>>> that set in the response. >>>> >>>> I've checked in a change where we always set the error code passed >>>> in the Failure - it looks reasonable. >>>> >>>> Martin >>>> > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers |
|
From: Martin A. <sp...@ma...> - 2008-07-09 07:05:09
|
On 9 Jul 2008, at 00:35, Bill Burke wrote: > Martin, couple problems with your commit: > > 1) You broke other tests that depended on 400. Please run whole > testsuite next time, thanks. Uhm, no?! I did run the whole test suite and it goes through fine - unless I've misunderstood how to run it (see below). > 2) I believe, after looking at those broken tests, that I ported the > test from Jersey's testsuite. This means that we might have to > change the behavior back to the way it was. We'll see what happens > with the TCK. Yes, the tests are amended from 400 to 404 - happy to change that back. But then we go back to what is the wanted behaviour? (see previous email) queen$ svn up At revision 251. queen$ svn st queen$ mvn clean test [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] Resteasy JAX-RS ....................................... SUCCESS [0.462s] [INFO] JAX-RS Core API ....................................... SUCCESS [1.252s] [INFO] RESTEasy JAX-RS Common Implementation ................. SUCCESS [0.026s] [INFO] RESTEasy JAX-RS Implementation ........................ SUCCESS [7.167s] [INFO] Resteasy JAX-RS Template Webapp ....................... SUCCESS [0.206s] [INFO] Resteasy JAX-RS Distribution .......................... SUCCESS [0.081s] [INFO] RESTEast JAX-RS Client ................................ SUCCESS [0.023s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL |
|
From: Martin A. <sp...@ma...> - 2008-07-09 14:49:24
|
On 9 Jul 2008, at 00:35, Bill Burke wrote: > 2) I believe, after looking at those broken tests, that I ported the > test from Jersey's testsuite. This means that we might have to > change the behavior back to the way it was. We'll see what happens > with the TCK. I've reverted back so that we're once again getting 400 when we encounter bad numbers. This means I've changed the test suites back as well. So currently Ryan does not get a 404 for the resource method taking an integer. M |