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

Improve error reporting #34

Closed
lukexi opened this issue Jul 20, 2015 · 3 comments
Closed

Improve error reporting #34

lukexi opened this issue Jul 20, 2015 · 3 comments
Assignees

Comments

@lukexi
Copy link
Contributor

lukexi commented Jul 20, 2015

As seen in #31, stack-ide fails to report configuration errors at startup, and instead responds with

{"tag":"ResponseWelcome","contents":[0,1,0]}
{"tag":"ResponseUpdateSession","contents":null}

(without compiling anything)

A call to "RequestGetSourceErrors" works to trigger an actual helpful error, e.g.:
{"tag":"RequestGetSourceErrors","contents":[]} {"tag":"ResponseGetSourceErrors","contents":[{"errorSpan":{"tag":"TextSpan","contents":"<<server died>>"},"errorKind":"KindServerDied","errorMsg":"/Users/lukexi/.stack/snapshots/x86_64-osx/lts-2.17/7.8.4/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (not a ghc-pkg db file, wrong file magic number)"}]}

It would be great to find a way to trigger the error immediately on startup.

(I'll create a separate issue on ide-backend for the particular error in the example, which can be solved by making sure the project is using the same snapshot that ide-backend was built against — do we need a separate version of ide-backend-server for each package db?)

@lukexi lukexi changed the title Improve stack-ide error reporting Improve error reporting Jul 20, 2015
@mgsloan
Copy link
Contributor

mgsloan commented Jul 21, 2015

I recently created an ide-backend issue that ought to cover this - does it? fpco/ide-backend#292

do we need a separate version of ide-backend-server for each package db?

I think we'd just need a separate version of ide-backend-server for each ghc version

@mgsloan
Copy link
Contributor

mgsloan commented Jul 24, 2015

I've added more detailed progress reporting for recompilation, including better reporting of failure cases and server restarts: fpco/ide-backend@702082d

I've also added logging, and plumbed it through stack-ide as ResponseLog messages: fpco/ide-backend@0c61a1f 7c81675

Finally, I removed KindServerDied, which doesn't seem like the right way to solve this: fpco/ide-backend@b7e5460

Do these changes address the problem adequately?

@lukexi
Copy link
Contributor Author

lukexi commented Jul 24, 2015

Hi Michael,
Yep, that's looking awesome. I can send the logs to the Sublime console and that'll be super helpful for debugging failures. It also reports startup failure right away as I hoped : ). Thanks a bunch!

@lukexi lukexi closed this as completed Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants