Skip to content

Error messages from read_mdim() that can neither be caught nor suppressed #763

@pepijn-devries

Description

@pepijn-devries

When calling the code below:

Sys.setenv(AWS_S3_ENDPOINT     = "s3.waw3-1.cloudferro.com")
Sys.setenv(AWS_NO_SIGN_REQUEST = "YES")
Sys.setenv(AWS_VIRTUAL_HOSTING = "FALSE")

my_proxy <- stars::read_mdim(
  "/vsis3/mdl-native-14/native/GLOBAL_ANALYSISFORECAST_PHY_001_024/cmems_mod_glo_phy_anfc_0.083deg_PT1H-m_202406/2022/06/glo12_rg_1h-m_20220621-20220621_2D_hcst_R20220629.nc", proxy = TRUE
)

The following error message is printed in the console: "Error:NCpathcvt: stat=-36 (NetCDF: Invalid argument)". I suspect this is the netCDF driver used by GDAL trying (and failing) directory listing at the server. The problem is that I cannot catch these errors with tryCatch(), they can also not be suppressed with suppressWarnings() or suppressMessages().

Note that the code above still seems to work. But I think CRAN policy doesn't accept the use of stderr stream, which I think is the case. Maybe something to look into?

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions