You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can we make '"not all 'rnames' found or unique."' more specific, perhaps softer error? #60
The event was noted in build attempts for OSCA.intro. There is a unit test in BiocFileCache, so we can explore approaches to enhancing the user experience. Comments will provide more info.
I don't agree with a soft error and guessing at what the user wants. I do agree we could separate out these conditions and provide more helpful comments/messages to assist the end user with how to proceed.
In the OSCA.intro they also use a helper function to add if a url is not found and return the local path in one step; I really never liked this helper function but it exists but should be used with caution. It could likely also be smoothed out if they did the longer query to see if it exists and then the user decide if they need to add or what resource path to grab which would also likely provide more information in each of these steps.
It seems like if you actually run this manually you can already tell what the issue is (not found or not unique) in the warnings messages that are produced as depending on if the function is trying to return values or trying to add values it ends up in different calls...so those soft fail with a warning to later fail with the hard error (as it either wasn't downloaded so can't return the path, or matched multiple and did know which to return [and the warning message gives suggestions on how to remedy already])
not unique
> bfcrpath(bfc, "rname1")
Error in bfcrpath(bfc, "rname1") : not all 'rnames' found or unique.
In addition: Warning message:
In FUN(X[[i]], ...) : 'rnames' exact pattern
'rname1'
is not unique; use 'bfcquery()' to see matches.
not found
> bfcrpath(bfc, rname="rname2", fpath="https://httpbin.org/status/404")
adding rname 'rname2'
Error in bfcrpath(bfc, rname = "rname2", fpath = "https://httpbin.org/status/404") :
not all 'rnames' found or unique.
In addition: Warning messages:
1: download failed
web resource path: 'https://httpbin.org/status/404'
local file path: '/home/lorikern/.cache/R/BiocFileCache/d57630f16d81_404'
reason: HTTP 404 Not Found.
2: bfcadd() failed; resource removed
rid: BFC4
fpath: 'https://httpbin.org/status/404'
reason: download failed
3: In value[[3L]](cond) :
trying to add rname 'rname2' produced error:
bfcadd() failed; see warnings()
Another solution is to do the check if the id exists and then choose addition or just return path using the individual steps rather than use this "helper" function that tries to be smart which seems to obscure failures.
Activity
lshep commentedon Mar 25, 2025
I don't agree with a soft error and guessing at what the user wants. I do agree we could separate out these conditions and provide more helpful comments/messages to assist the end user with how to proceed.
In the OSCA.intro they also use a helper function to add if a url is not found and return the local path in one step; I really never liked this helper function but it exists but should be used with caution. It could likely also be smoothed out if they did the longer query to see if it exists and then the user decide if they need to add or what resource path to grab which would also likely provide more information in each of these steps.
lshep commentedon May 13, 2025
It seems like if you actually run this manually you can already tell what the issue is (not found or not unique) in the warnings messages that are produced as depending on if the function is trying to return values or trying to add values it ends up in different calls...so those soft fail with a warning to later fail with the hard error (as it either wasn't downloaded so can't return the path, or matched multiple and did know which to return [and the warning message gives suggestions on how to remedy already])
not unique
not found
lshep commentedon May 13, 2025
Another solution is to do the check if the id exists and then choose addition or just return path using the individual steps rather than use this "helper" function that tries to be smart which seems to obscure failures.