Skip to content

Fix thrown errors breaking out of --watch mode#1627

Merged
JakeDawkins merged 1 commit intomasterfrom
jake/fix-watchmode-errors
Oct 29, 2019
Merged

Fix thrown errors breaking out of --watch mode#1627
JakeDawkins merged 1 commit intomasterfrom
jake/fix-watchmode-errors

Conversation

@JakeDawkins
Copy link
Copy Markdown
Contributor

Currently, if you write an operation that throws an error in the validation step of codegen while in --watch mode, the watching will stop.

This PR changes a couple things to prevent that.

  1. instead of throwing an error in the validation step, we use the error logger from apollo-language-server.
  2. Changes the error logger that the CLI sets from using this.error (which exits with a 1 code) to console.error.
  3. Updates the watch mode function to catch thrown errors properly, as well as printing how many files are written.

TODO:

  • Update CHANGELOG.md* with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

*Make sure changelog entries note which project(s) has been affected. See older entries for examples on what this looks like.

@JakeDawkins JakeDawkins merged commit 0eab310 into master Oct 29, 2019
@JakeDawkins JakeDawkins deleted the jake/fix-watchmode-errors branch October 29, 2019 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant