Skip to content

Add errors for 404 and HTML responses#1713

Merged
JakeDawkins merged 3 commits intomasterfrom
jake/introspection-errors
Dec 9, 2019
Merged

Add errors for 404 and HTML responses#1713
JakeDawkins merged 3 commits intomasterfrom
jake/introspection-errors

Conversation

@JakeDawkins
Copy link
Copy Markdown
Contributor

@JakeDawkins JakeDawkins commented Dec 9, 2019

Two of the most common errors that people encounter in the CLI and VS Code extension revolve around introspecting of schemas.

  1. Unless an API key, endpoint, or localSchemaFile are provided, the language server relies on the default endpoint http://localhost:4000. If there is no server running there, it will 404. If the user has a service to run there (or anywhere else) but forgets to start it up, it will also 404. This PR adds an error for both of those cases. If the URL IS the default one, it will provide info about that.
  2. If users are trying to introspect a url without authentication (or some other cases) the endpoint will return an HTML response, which the CLI can't parse. This PR adds an error mentioning auth and potentially invalid URLs.

Screen Shot 2019-12-09 at 10 17 04 AM

Screen Shot 2019-12-09 at 10 37 00 AM

Screen Shot 2019-12-09 at 10 10 41 AM

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 bedd6ea into master Dec 9, 2019
@JakeDawkins JakeDawkins deleted the jake/introspection-errors branch December 9, 2019 15:59
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