From ripley at stats.ox.ac.uk  Tue Apr 26 08:25:27 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue Apr 26 08:25:46 2005
Subject: [Rd] Feature request: report the url if 404 error occurs
In-Reply-To: <m2ll76rz8i.fsf@fhcrc.org>
References: <m2ll76rz8i.fsf@fhcrc.org>
Message-ID: <Pine.LNX.4.61.0504260721440.2948@gannet.stats>

On Mon, 25 Apr 2005, Seth Falcon wrote:

> Currently, the connection code does not include the URL in the warning
> message when a 404 response is received:
>
> myUrl = "http://www.r-project.org/ABadPage.html"
> con = url(myUrl)
> readLines(con)
>
>  Error in readLines(con) : cannot open the connection
>  In addition: Warning message:
>  cannot open: HTTP status was '404 Not Found'
>
> Would it be possible (and desirable) to include the URL in the warning
> message?  Here's an example:
>
> Error in readLines(con) : cannot open the connection
> In addition: Warning message:
> cannot open 'http://www.r-project.org/ABadPage.html': HTTP status was '404 Not Found'

It is part of `con':

> con
                              description
"http://www.r-project.org/ABadPage.html"
                                    class
                                    "url"
                                     mode
                                      "r"
                                     text
                                   "text"
                                   opened
                                 "closed"
                                 can read
                                    "yes"
                                can write
                                     "no"

Remember R is an interactive system: you just need to ask it for the 
information you want.

This would be tedious to add, but you could submit a patch (remember there 
are at least three places to look at in the internet code).

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] Feature request: report the url if 404 error occurs
Prof Brian Ripley