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
In the following sample code, no error is returned from configstore.Open("DOES_NOT_EXIST"), but a configstore.ErrStoreNotFound error is returned from cs.Get("cat").
cs, err:=configstore.Open("DOES_NOT_EXIST") // err == nilswitch {
caseerrors.Is(err, configstore.ErrStoreNotFound):
fsthttp.Error(w, "config store not found: configstore.Open", fsthttp.StatusNotFound)
returncaseerr!=nil:
fsthttp.Error(w, fmt.Sprintf("error opening config store: %s", err.Error()), fsthttp.StatusInternalServerError)
return
}
v, err:=cs.Get("cat") // err == configstore.ErrStoreNotFoundswitch {
caseerrors.Is(err, configstore.ErrStoreNotFound):
fsthttp.Error(w, "config store not found: cs.Get", fsthttp.StatusNotFound)
returncaseerrors.Is(err, configstore.ErrKeyNotFound):
fsthttp.Error(w, "config store key not found", fsthttp.StatusNotFound)
returncaseerr!=nil:
fsthttp.Error(w, fmt.Sprintf("error opening config store key: %s", err.Error()), fsthttp.StatusInternalServerError)
return
}
To better match the Rust SDK, and to provide a better user experience, consider returning a configstore.ErrStoreNotFound from configstore.Open when the named config store does not exist.
In the following sample code, no error is returned from
configstore.Open("DOES_NOT_EXIST")
, but aconfigstore.ErrStoreNotFound
error is returned fromcs.Get("cat")
.To better match the Rust SDK, and to provide a better user experience, consider returning a
configstore.ErrStoreNotFound
fromconfigstore.Open
when the named config store does not exist.Possibly related: #118
The text was updated successfully, but these errors were encountered: