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

Better CLI errors #34

Closed
rrdelaney opened this issue Aug 15, 2017 · 1 comment
Closed

Better CLI errors #34

rrdelaney opened this issue Aug 15, 2017 · 1 comment
Assignees
Projects
Milestone

Comments

@rrdelaney
Copy link
Owner

Here's what it looks like when the input has a syntax error:

screen shot 2017-08-14 at 10 38 50 pm

and here's what it looks like when the syntax is valid, but we can't produce output for some reason:

screen shot 2017-08-14 at 10 41 40 pm

These errors aren't friendly at all, and need to be cleaned up. A codeframe would be nice for parser errors, and when we can't generate output, a codeframe and a better explanation would be nice, as well as a link to our issue tracker 😄

Spec

  • For parser error, output a detailed syntax error and codeframe
  • For compiler errors (we can't generate output), output a codeframe and why we can't generate the code, maybe a link to our issue tracker as well

Implementation details

This should happen at the JS level, not the compiler - somewhere in the CLI code. Something like babel-code-frame would do most of what we want for us as far as output goes. There might be some Reason code necessary to extract better errors from the Flow parser, possibly in retyped_node.re or the main JS interface index.js.

As always, I'm available to help in the ReasonML Discord or on here!

@rrdelaney rrdelaney added this to the 0.12 milestone Aug 15, 2017
@rrdelaney rrdelaney added this to To Do in CLI Aug 15, 2017
@rrdelaney rrdelaney self-assigned this Aug 23, 2017
@rrdelaney rrdelaney modified the milestones: 0.11, 0.12 Aug 23, 2017
@rrdelaney
Copy link
Owner Author

Looking good!

screen shot 2017-08-26 at 9 16 46 am

@rrdelaney rrdelaney moved this from To Do to In Progress in CLI Aug 26, 2017
@rrdelaney rrdelaney moved this from In Progress to Done in CLI Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
CLI
Done
Development

No branches or pull requests

1 participant