[R-pkg-devel] http error handling in packages

Uwe Ligges ||gge@ @end|ng |rom @t@t|@t|k@tu-dortmund@de
Wed Sep 8 09:29:03 CEST 2021



On 08.09.2021 02:02, obrl soil wrote:
> Hello list,
> 
> my package 'slga' has been flagged for potential removal from CRAN
> because of the following:
> 
>> Please see the problems shown on
>> <https://cran.r-project.org/web/checks/check_results_slga.html>.
> 
>> Please correct before 2021-09-19 to safely retain your package on CRAN.
> 
>> It seems we need to remind you of the CRAN policy:
> 
>> 'Packages which use Internet resources should fail gracefully with an informative message
>> if the resource is not available or has changed (and not give a check warning nor error).'
> 
>> This needs correction whether or not the resource recovers.
> 
> The issue is that the WCS server from which the package retrieves data
> sometimes gets overloaded, and throws a 502 error. I currently use a
> stop(message)) to return the http error code to the user, e.g. here -
> https://github.com/obrl-soil/slga/blob/a770dac9f101995db92e2d42476af8705971d80c/R/get_data.R#L61
> 
> I just want to clarify whether the problem is an overly brief error
> message, or my use of stop() in this context? What is the preferred
> pattern for handling these kinds of errors?

Exit gracefully, i.e. without an ERROR.

Best,
Uwe Ligges


> 
> Many thanks,
> Lauren O'Brien
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>



More information about the R-package-devel mailing list