On 10/21/05, Pierre Garigue <[EMAIL PROTECTED]> wrote:
> I because I 'rescue' everything, getting a 500 or 404 would just give me a 
> fail. I would like to add info to the log that is failed and got this http 
> status.

I too am using the basic "rescue" technique, which doesn't really give
me a whole lot to work with.  I read through the technical docs[1] and
couldn't find anything more specific.  Perhaps this feature does not
exist?

I wonder what would happen if I turned on friendly error messages ..
then if rescue catches the error, could I scan the page or title to
determine the nature of the error?

Here is my "go to" method, used with
goto("http://example.org/foo/bar.html";) or goto(variable).  It's
different than yours because it notices succesfully-loaded, but
redirected pages:

def goto(url)
        begin
                puts "* going to " + url
                $ie.goto(url)
        rescue
                puts ">>>ERROR"
        else
                puts "   ok, destination loads"
        end
        if $ie.url() == url
                puts "   ok, I stayed at the destination url"
        else
                puts "   warning: rewriting or redirection took effect"
        end
end


[1] http://wtr.rubyforge.org/rdoc/index.html

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to