Seth Falcon
2005-Apr-26 05:30 UTC
[Rd] Feature request: report the url if 404 error occurs
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' + seth
Prof Brian Ripley
2005-Apr-26 08:25 UTC
[Rd] Feature request: report the url if 404 error occurs
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':> condescription "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