[R-pkg-devel] Internet resources and Errors

Roy Mendelssohn - NOAA Federal roy@mende|@@ohn @end|ng |rom no@@@gov
Fri Sep 24 18:09:16 CEST 2021


Thanks to all who replied.  I want to especially point out Maelle's response because as I said I am not the first person to raise this question in terms of accessing internet resources.  Yes,  graceful is in the eye of the beholder,  which i why such guidelines are really helpful.

-Roy

> On Sep 24, 2021, at 8:59 AM, Duncan Murdoch <murdoch.duncan using gmail.com> wrote:
> 
> On 24/09/2021 11:27 a.m., Roy Mendelssohn - NOAA Federal via R-package-devel wrote:
>> Just so I am clear,  I should not call stop(),  but instead call a return() and return something or other  (there is nothing to skip to - it is doing a data download and either it works or it failed).  Is there a preferred something to return?  And it is okay to write a message to the screen?
> 
> I don't think it matters what you return, as long as the caller understands that it didn't get any data.  If this is a function you export, make sure to describe that possibility in its help page.
> 
> As far as I know it's okay to use message() (or cat() or print(), but message() is preferred) to give your message, just not stop() or warning() -- those will signal a problem to CRAN that you should fix.
> 
> Duncan Murdoch
> 
>> I should add that when I first ran into this awhile back I asked what "failed gracefully" means,  and never received a response.  To me,  writing out a message to the user and stopping is graceful exit, but obviously it is not.  What would help then, since this problem has been cited by others, is more explicit guidelines as to what constitutes a graceful exit with examples.  My $0.02
>> -Roy
>>> On Sep 24, 2021, at 8:03 AM, Ben Bolker <bbolker using gmail.com> wrote:
>>> 
>>>  I think you're not supposed to stop().
>>> 
>>>  You should just proceed with the other tests (skipping any tests/examples that depend on access to the inaccessible internet resources, or values derived from the failing call, to work)
>>> 
>>>  Does that help?
>>> 
>>> On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel wrote:
>>>> Hi All:
>>>> I am getting dinged again on CRAN  (just Solaris for some reason),  and the problem is how to exit if there is a failure of accessing the resource,  I know it has been discussed here before,  but I just am not understanding what is desired to end properly. As I have been reminded:
>>>> '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).'
>>>> All internet calls are wrapped in 'try()'.  If that shows an error,  I  write a message to the screen about the error,  and call stop(), perhaps with a further message in that call.   Somehow this does not appear to meet the standard.    Can someone then please tell me what I should do instead.  The point is I have checked that the access to the internet resources has worked,  i have seen that it hasn't,  now what should be the steps to take to exit gracefully.
>>>> I also want to add to what others have said about the frustrations of dealing with Solaris.  I have spent a fair amount of time getting things to  work with Solaris which no one uses.  In this instance the package test is only failing on Solaris.   Not a good use of limited time IMO.
>>>> Thanks for any advice.
>>>> -Roy
>>>> **********************
>>>> "The contents of this message do not reflect any position of the U.S. Government or NOAA."
>>>> **********************
>>>> Roy Mendelssohn
>>>> Supervisory Operations Research Analyst
>>>> NOAA/NMFS
>>>> Environmental Research Division
>>>> Southwest Fisheries Science Center
>>>> ***Note new street address***
>>>> 110 McAllister Way
>>>> Santa Cruz, CA 95060
>>>> Phone: (831)-420-3666
>>>> Fax: (831) 420-3980
>>>> e-mail: Roy.Mendelssohn using noaa.gov www: https://www.pfeg.noaa.gov/
>>>> "Old age and treachery will overcome youth and skill."
>>>> "From those who have been given much, much will be expected"
>>>> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
>>>> ______________________________________________
>>>> R-package-devel using r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>> 
>>> -- 
>>> Dr. Benjamin Bolker
>>> Professor, Mathematics & Statistics and Biology, McMaster University
>>> Director, School of Computational Science and Engineering
>>> Graduate chair, Mathematics & Statistics
>>> 
>>> ______________________________________________
>>> R-package-devel using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>> **********************
>> "The contents of this message do not reflect any position of the U.S. Government or NOAA."
>> **********************
>> Roy Mendelssohn
>> Supervisory Operations Research Analyst
>> NOAA/NMFS
>> Environmental Research Division
>> Southwest Fisheries Science Center
>> ***Note new street address***
>> 110 McAllister Way
>> Santa Cruz, CA 95060
>> Phone: (831)-420-3666
>> Fax: (831) 420-3980
>> e-mail: Roy.Mendelssohn using noaa.gov www: https://www.pfeg.noaa.gov/
>> "Old age and treachery will overcome youth and skill."
>> "From those who have been given much, much will be expected"
>> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
>> ______________________________________________
>> R-package-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn using noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



More information about the R-package-devel mailing list