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

encoding/json: SyntaxError's Error() should print Offset in addition to msg #7636

Closed
gopherbot opened this issue Mar 25, 2014 · 4 comments
Closed

Comments

@gopherbot
Copy link

by antarus@google.com:

What does 'go version' print?

go version
go version go1.2 linux/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

http://play.golang.org/p/czb8BWDs4_

What happened?

I got an error.

What should have happened instead?

The error I received should tell me where in the very large bytestream it was parsing,
it encountered a parsing error.

Please provide any additional information below.

I checked the source tree on code.google.com and this still seemed unimplemented.

-A
@gopherbot
Copy link
Author

Comment 1 by antarus@google.com:

func (e *SyntaxError) Error() string { return e.msg }
Should be something like:
func (e *SyntaxError) Error() string { return fmt.Sprintf("%s at offset: %s", e.msg,
e.Offset)
}
or similar.

@minux
Copy link
Member

minux commented Mar 27, 2014

Comment 2:

https://golang.org/cl/81260043

Owner changed to @minux.

Status changed to Started.

@gopherbot
Copy link
Author

Comment 3:

CL https://golang.org/cl/81260043 references this issue.

@rsc
Copy link
Contributor

rsc commented May 21, 2014

Comment 4:

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants