Skip to content
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

TypeError PrettyPrint regression #534

Closed
braydonk opened this issue Nov 14, 2024 · 4 comments · Fixed by #535
Closed

TypeError PrettyPrint regression #534

braydonk opened this issue Nov 14, 2024 · 4 comments · Fixed by #535
Labels
bug Something isn't working

Comments

@braydonk
Copy link
Contributor

Describe the bug
Somewhere between v1.12.0 and v1.14.0, pretty printing for a type unmarshalling error broke.

To Reproduce

https://go.dev/play/p/51SbJmfrX_D

Expected behavior
Manually running this with go-yaml v1.12.0 I get:

[1:4] cannot unmarshal string into Go struct field a.X of type bool
    >  1 | x: hi
              ^

I implemented this feature in #280

Screenshots
If applicable, add screenshots to help explain your problem.

Version Variables

  • Go version: 1.23
  • go-yaml's Version: v1.14.0, compared against v1.12.0
@braydonk braydonk added the bug Something isn't working label Nov 14, 2024
@braydonk
Copy link
Contributor Author

A bisect determined that #483 is the PR that broke this.

@braydonk
Copy link
Contributor Author

The entire wrapError type was removed in that PR, which is probably why this is happening. The FormatError method of TypeError will never get called anymore, and the Error() method will be used on its own instead.

@goccy goccy mentioned this issue Nov 14, 2024
@goccy
Copy link
Owner

goccy commented Nov 14, 2024

Thank you for your reports ! I've fixed this problem with v1.14.1 !

@braydonk
Copy link
Contributor Author

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants