Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(185)

Issue 207059: Continued improvement to exception handling code (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 11 months ago by johnfargo
Modified:
15 years, 11 months ago
Reviewers:
zhoresh, shindig.remailer, Matt T. Proud (mtp)
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

I'm committing this code early since we need it in fairly short order and it seems quite low-risk: familiar design pattern, no semantic difference in any behavior, just cleanup. Still, the line count is somewhat higher than I'm comfortable committing blindly, so I'm putting this out for review. Happy to clean up per anyone's comments as a follow-up.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -49 lines) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java View 2 chunks +2 lines, -1 line 2 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/GadgetException.java View 2 chunks +32 lines, -5 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/process/Processor.java View 1 chunk +1 line, -2 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/DefaultRpcServiceLookup.java View 1 chunk +0 lines, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/HtmlRenderer.java View 2 chunks +2 lines, -6 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/OpenSocialI18NGadgetRewriter.java View 4 chunks +6 lines, -5 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/Renderer.java View 1 chunk +2 lines, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderingException.java View 1 chunk +0 lines, -2 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderingGadgetRewriter.java View 1 chunk +1 line, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/CssRequestRewriter.java View 6 chunks +7 lines, -6 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/HTMLContentRewriter.java View 4 chunks +4 lines, -4 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/RewritingException.java View 1 chunk +11 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/rewrite/TemplateRewriter.java View 1 chunk +2 lines, -4 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/CssRequestRewriterTest.java View 4 chunks +5 lines, -5 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/rewrite/HTMLContentRewriterTest.java View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6
johnfargo
15 years, 11 months ago (2010-02-10 21:42:36 UTC) #1
zhoresh
LGTM http://codereview.appspot.com/207059/diff/1/14 File java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java (right): http://codereview.appspot.com/207059/diff/1/14#newcode134 java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java:134: response.getHttpStatusCode()); If the external system return 500, should ...
15 years, 11 months ago (2010-02-10 22:17:50 UTC) #2
johnfargo
IMO we should return 500 when there's an Exception within the fetcher, but 504 when ...
15 years, 11 months ago (2010-02-10 22:36:33 UTC) #3
Matt T. Proud (mtp)
http://codereview.appspot.com/207059/diff/1/14 File java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java (right): http://codereview.appspot.com/207059/diff/1/14#newcode134 java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java:134: response.getHttpStatusCode()); On 2010/02/10 22:17:50, zhoresh wrote: > If the ...
15 years, 11 months ago (2010-02-11 10:57:23 UTC) #4
johnfargo
On Thu, Feb 11, 2010 at 2:57 AM, <mtp@google.com> wrote: > > http://codereview.appspot.com/207059/diff/1/14 > File ...
15 years, 11 months ago (2010-02-11 21:29:06 UTC) #5
Matt T. Proud (mtp)
15 years, 11 months ago (2010-02-15 10:35:25 UTC) #6
John,

What you've done makes sense and looks good to me.  Thanks for being
especially mindful of the HTTP response code nuances.

- M.

On Thu, Feb 11, 2010 at 10:29 PM, John Hjelmstad <johnfargo@gmail.com> wrote:
> On Thu, Feb 11, 2010 at 2:57 AM, <mtp@google.com> wrote:
>>
>> http://codereview.appspot.com/207059/diff/1/14
>> File
>>
>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java
>> (right):
>>
>> http://codereview.appspot.com/207059/diff/1/14#newcode134
>>
>>
java/gadgets/src/main/java/org/apache/shindig/gadgets/AbstractSpecFactory.java:134:
>> response.getHttpStatusCode());
>> On 2010/02/10 22:17:50, zhoresh wrote:
>>>
>>> If the external system return 500, should we as well?
>>> maybe 504?
>>
>> There is a small subset of 500s---e.g., 50{2,4}---that we should not
>> demur from using.  I think a gateway- or proxy-related one is fine.
>
> Agreed. In my latest CL (http://codereview.appspot.com/207060/show) I've
> taken this advice to use SC_BAD_GATEWAY in situations where the request
> itself was legitimately formed but Shindig nevertheless couldn't correctly
> process the request, in an attempt to honor the spirit of HTTP status code
> 400 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html): "The client
> SHOULD NOT repeat the request without modifications".
>
> Having done this, I wonder if there are circumstances in which
> SC_BAD_REQUEST is being used when BAD_GATEWAY should be. If you've got a
> moment to peek around I'd be interested in your thoughts.
> Cheers,
> John
>>
>>
>> http://codereview.appspot.com/207059/show
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b