-
-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParseWithOptions not returning error from custom function #268
Comments
have you tried this? https://github.com/caarlos0/env#not-empty-fields |
ahh I see what you mean, regardless of that, the error from the custom parser does not bubble up. nice, thanks for reporting, will take a look. fwiw, minimal reproducible: https://play.golang.com/p/ijP_1MxhRp7 |
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0, should I take a look if I find time? |
see #269 |
ok, after looking into this again, this is the expected behavior:
if you want this to fail, you can set |
Hi,
i am trying to work this out for a while now. The main goal is to parse a shoutrrr url from envs.
I could just create a sender with a string that has been parsed and check for error there. But i would like to use the FuncMap for custom parsing. What am i doing wrong?
The code is based on the the example
https://play.golang.com/p/4h5IqZLB0Hs
When run with debugger and NOTIFICATION_URL not set, the error returned from
ParseWithOptions()
is not nil:error(github.com/caarlos0/env/v8.AggregateError) {Errors: []error len: 1, cap: 1, [*(*error)(0x1400017c320)]}
But as soon as the env is set, but empty, no error is returned...
The text was updated successfully, but these errors were encountered: