Re: [Bug 5537] Checker aborts on bad URI in redirect

Le jeudi 06 mars 2008 à 21:35 -0500, Sean Owen a écrit :
> Question on this one -- according to the code this is kinda intended
> behavior. If the last request ended in some kind of exception we
> assume we don't actually have a document to test, so there are no
> results to report.

Note that in the case put in the bug report (although I didn't make this
clear), the redirect is not happening on the main document, but on an
embedded image.

> I kind of agree with this and recall a long argument on a whiteboard
> about this. Just checking, what do people think about the right
> behavior here? Garbage in, garbage out, I say, so I am not
> particularly concerned if a situation like this results in an
> exception (subsequently, looks like a change has turned this internal
> exception into a more appropriate TestException), or if it becomes
> some meaningless test results stating that the result is fail fail
> fail because the body is empty and all kinds of screwed up as a
> result. Just a different garbage out.
> 
> I'm happy to 'fix' this, just want to know if everyone agrees with
> that, or whether this needs discussion.

My view is that we should have as few uncaught TestException as possible
- in fact, I can't really think of a good case where we should have one.
Generally speaking, we should try to report as many errors as possible,
and when encountering a problem we don't know how to solve, we should
probably report it in one of our existing error type (HTTP_RESPONSE,
MAIN_DOCUMENT).

In the case of a redirect to a garbage-like URI, I think we should make
our best attempt to un-garbage the URI, much like browsers do today -
maybe we could use a derived class of URI() that does some prettifying
before calling the real URI() constructor? But when even that fails, we
should report this as a MAIN_DOCUMENT-1 when this affects the main
document, or HTTP_RESPONSE-1 when it affects a sub-request.

Dom

Received on Friday, 7 March 2008 08:37:52 UTC