-
-
Notifications
You must be signed in to change notification settings - Fork 469
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
errors in copier.TypeConverters are not returned from the CopyWithOption function and values with error are not applied #158
Comments
XiXiangFiles
pushed a commit
to XiXiangFiles/copier
that referenced
this issue
Sep 15, 2022
XiXiangFiles
pushed a commit
to XiXiangFiles/copier
that referenced
this issue
Sep 15, 2022
fixed. let error will raise up if the error is happening. |
XiXiangFiles
pushed a commit
to XiXiangFiles/copier
that referenced
this issue
Sep 20, 2022
If I understand correctly you are aiming at returning an error message if the source and destinations types are not a match and not convertible? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproducible Example
https://go.dev/play/p/lrlMEMSFKZ_N
Description
If an error is returned in a
copier.TypeConverter
, thecopier.CopyWithOption
returns nil for the error and the value is not applied to the destination.In the Go Playground example above, the custom converter returns an error as well as the value "invalid".
I would expect copier.CopyWithOption to return the error and for dest.Val to be "invalid".
We are happy to work on the fix if this is indeed an issue.
The text was updated successfully, but these errors were encountered: