ecmwfr
ecmwfr copied to clipboard
Cryptic error if `request$dataset_short_name` is NULL
Running the example request returns in an empty error.
request <- list(stream = "oper",
levtype = "sfc",
param = "167.128",
dataset = "interim",
step = "0",
grid = "0.75/0.75",
time = "00",
date = "2014-07-01/to/2014-07-02",
type = "an",
class = "ei",
area = "50/10/51/11",
format = "netcdf",
target = "tmp.nc")
data <- ecmwfr::wf_request(request, user = "94905")
#> Error:
Created on 2021-07-01 by the reprex package (v2.0.0)
The issue is here:
https://github.com/bluegreen-labs/ecmwfr/blob/32101273e76fa78ba1f0e0fe1dbd986dddbd3da7/R/wf_request.R#L130-L136
If request$dataset_short_name
is NULL the result of sprintf()
is an empty string.
[EDITED]: This is user error (where I'm the user). This is a valid webapi error, but I was using a CDS user. Still, the error message should be fixed!