Baoqiang Cao
2008-Sep-24 19:56 UTC
[R] problem with catching error message in open function
Hi R-helpers, I'm extracting data from an public server, since there is a restriction such that I have to submit my entries one by one (I have 10^5 entries). I partially succeeded with using tf <- open(url, "r") if(isOpen(tf, "r")) {readLines(tf)} close(tf) Some entries successfully were returned and read by readLine, then all the sudden, the program stopped with the following error: "The error message is unable to open connection cannot open: HTTP status was '502 Bad Gateway' Execution halted" Is there anyway that I could catch the error from the "open" function? I'd like the program not being halted when the bad connection happens. Any help please? Best, Baoqiang