Effect-TS/io

Configurable path delimiter in ConfigError

Closed this issue · 1 comments

I've built myself a simple file-system configuration provider. It works fine but I would like to improve the error messages that are produced when a configuration is not found, supported, or valid. For example, returning a:

Effect.fail(ConfigError.MissingData([...path], "Path not found"));

from the load function of the ConfigProvider would result in the following error message in case of nested configuration:

(Missing data at /secrets.MYSQL_PASSWORD: "Path not found")

I would like to be able to say:

Effect.fail(ConfigError.MissingData([...path], "Path not found", { pathDelim: "/" }));

and get the following instead:

(Missing data at /secrets/MYSQL_PASSWORD: "Path not found")

Closing as related pr #576 got merged, thanks!