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
Additional context
Stumbled accross this because I'm trying to figure out a good way to handle errors when reading configuration (from env variables but that could be in a file as well). Generally speaking, is it a good idea to delay error handling in that case? I understand that this fx.Error allows to delay config read error after the call to fx.New thus maybe allows to execute cleanup code if needed.
edit: regarding that Provide error, would this make any sense to have a hook that triggers on Provide errors (e.g. before app.Start here)
The text was updated successfully, but these errors were encountered:
Describe the bug
The example provided here does not seem to work as expected. If PORT is not defined it correctly prints
However if PORT is defined it fails
To Reproduce
Drop the example in a go unit test and add
t.SetEnv("PORT", 8080)
Expected behavior
I guess the call to fx.Provide must be replaced with
which actually reaches
fx.Invoke ListenAndServe
Additional context
Stumbled accross this because I'm trying to figure out a good way to handle errors when reading configuration (from env variables but that could be in a file as well). Generally speaking, is it a good idea to delay error handling in that case? I understand that this
fx.Error
allows to delay config read error after the call tofx.New
thus maybe allows to execute cleanup code if needed.edit: regarding that Provide error, would this make any sense to have a hook that triggers on Provide errors (e.g. before app.Start here)
The text was updated successfully, but these errors were encountered: