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
The administrator read an error strating by "error calling UnmarshalText", but this string is related to program internal behavior. The administrator dont care about this information. This information could be perturbated by this information and could contact software support.
Sorry for the wait! I think that's a reasonable change. I am a little worried about the loss of information for a programmer who would be implementing unmarshaling for their own types, but at that point they probably know where the issue may be coming from. Feel free to open a PR!
pelletier
changed the title
Error readability
UnmarshalText error readability
Mar 2, 2022
Describe the bug
I use go-toml to parse a configuration file. The parsing errors are shown by a system administrator and not by a developper.
I implement a Marshaller to Unmarshal some type (time.Duration in example). When my duration is wring, I read this message:
The administrator read an error strating by "error calling UnmarshalText", but this string is related to program internal behavior. The administrator dont care about this information. This information could be perturbated by this information and could contact software support.
To Reproduce
https://go.dev/play/p/6YvcBbolsFu
Expected behavior
I suggest when the marshaller return a error, the error is reported as-is (without prefix).
If you're ok, I could write a PR
Versions
The text was updated successfully, but these errors were encountered: