Skip to content

Commit e1c93e8

Browse files
committed
add third try() around blosc/zarr
1 parent 7ff1e53 commit e1c93e8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/gdal_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ Rcpp::CharacterVector CPL_gdalmdiminfo(Rcpp::CharacterVector obj, Rcpp::Characte
457457
GDALDatasetH ds = GDALOpenEx((const char *) obj[0], GDAL_OF_MULTIDIM_RASTER | GDAL_OF_VERBOSE_ERROR , NULL, oo_char.data(), NULL);
458458
if (ds == NULL) {
459459
Rcpp::Rcout << "failed to open " << obj[0] << std::endl;
460-
Rcpp::stop("Error opening data source");
460+
Rcpp::stop("cannot open data source");
461461
}
462462
std::vector <char *> options_char = create_options(options, true);
463463
GDALMultiDimInfoOptions* opt = GDALMultiDimInfoOptionsNew(options_char.data(), NULL);

tests/stars.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ gdal_metadata(tif)
7979
if (require(stars, quietly = TRUE)) {
8080
p = normalizePath(system.file("nc/ones.zarr.zip", package = "sf"))
8181
z = paste0('ZARR:/vsizip/"', p, '"/ones.zarr')
82-
gdal_utils("mdiminfo", z)
83-
cat("\n")
82+
d = try(gdal_utils("mdiminfo", z))
83+
if (!inherits(d, "try-error")) {
84+
print(d)
85+
cat("\n")
86+
}
8487
e = try(read_stars(z, normalize_path = FALSE), silent = TRUE)
8588
f = try(read_mdim(z, normalize_path = FALSE), silent = TRUE)
8689
if (inherits(e, "try-error") || inherits(f, "try-error")) {

0 commit comments

Comments
 (0)