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

Add more user-friendly errors #35

Open
amit-davidson opened this issue Nov 21, 2020 · 2 comments
Open

Add more user-friendly errors #35

amit-davidson opened this issue Nov 21, 2020 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@amit-davidson
Copy link
Owner

Enhancement

When the program panics the entire stack trace is returned. A more user friendly should be returned.
It should contain the failing stacktrace but also the following messages as in the example stacktrace below (taken from that of the stdlib pointer package):

  • Internal panic in while performing analysis: at the top

  • Error in analysis (please report this bug) at the bottom

For that, a recover should be added to the start of the program and catch all panics and wrap them with the added messages.

Internal panic in while performing analysis:
goroutine 1 [running]:
runtime/debug.Stack(0x24, 0x0, 0x0)
        /usr/local/Cellar/go/1.15.3/libexec/src/runtime/debug/stack.go:24 +0x9f
runtime/debug.PrintStack()
        /usr/local/Cellar/go/1.15.3/libexec/src/runtime/debug/stack.go:16 +0x25
golang.org/x/tools/go/pointer.Analyze.func1(0xc05b607b00)
        /Users/amdavidson/go/pkg/mod/golang.org/x/[email protected]/go/pointer/analysis.go:227 +0x10b
panic(0x13502e0, 0xc03aff2380)
        /usr/local/Cellar/go/1.15.3/libexec/src/runtime/panic.go:969 +0x1b9
golang.org/x/tools/go/pointer.(*analysis).taggedValue(0xc042b7d340, 0xc00002acfd, 0x2, 0x64, 0xc00d7a8000)
        /Users/amdavidson/go/pkg/mod/golang.org/x/[email protected]/go/pointer/gen.go:272 +0x105
golang.org/x/tools/go/pointer.(*invokeConstraint).solve(0xc0499eb780, 0xc042b7d340, 0xc082a8e400)
        /Users/amdavidson/go/pkg/mod/golang.org/x/[email protected]/go/pointer/solve.go:317 +0x24e
golang.org/x/tools/go/pointer.(*analysis).solveConstraints(0xc042b7d340, 0xc049a7f620, 0xc082a8e400)
        /Users/amdavidson/go/pkg/mod/golang.org/x/[email protected]/go/pointer/solve.go:165 +0x178
golang.org/x/tools/go/pointer.(*analysis).solve(0xc042b7d340)
        /Users/amdavidson/go/pkg/mod/golang.org/x/[email protected]/go/pointer/solve.go:59 +0x1ad
golang.org/x/tools/go/pointer.Analyze(0xc042efc690, 0x0, 0x1437dc0, 0xc03aff2390)
        /Users/amdavidson/go/pkg/mod/golang.org/x/[email protected]/go/pointer/analysis.go:331 +0x4bc
github.com/amit-davidson/Chronos/pointerAnalysis.Analysis(0xc02ebbdb00, 0xc02e1361e0, 0xc042cd6f00, 0x5c, 0x60, 0x0, 0x7c)
        /Users/amdavidson/go/pkg/mod/github.com/amit-davidson/[email protected]/pointerAnalysis/PointerAnalysis.go:51 +0x38a
main.main()
        /Users/amdavidson/go/pkg/mod/github.com/amit-davidson/[email protected]/cmd/chronos/main.go:35 +0x473
Error in analysis (please report this bug)
@amit-davidson amit-davidson added enhancement New feature or request good first issue Good for newcomers labels Nov 21, 2020
@shoniavika
Copy link

I can take this one!

@amit-davidson
Copy link
Owner Author

@shoniavika Feel free to take in the direction you feel like to. If you want to consult first, that's fine as well. You can reach me through the mail on my profile or here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants