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

Use a specific error class for Uplink connection errors #1439

Closed
nogates opened this issue Jan 26, 2022 · 3 comments
Closed

Use a specific error class for Uplink connection errors #1439

nogates opened this issue Jan 26, 2022 · 3 comments
Labels

Comments

@nogates
Copy link
Contributor

nogates commented Jan 26, 2022

Hello there!

I'd like to ask if it would be possible to have a specific error class to signal errors when pulling supergraph schema from uplink.

Right now, when this happens, a generic error is thrown, and if we want to catch those errors, we need to match the error message, which seems a bit brittle (I wouldn't be surprised if that message is changed in the future).

Would it be possible to extend the Error class with a more specific name (something like UplinkFetchError), and export it, so we can check the name of that error instead of the message?

A bit of context, we plan on catching these errors on our Gateways. If Apollo Uplink is down, we can at least rescue from those errors and use a local schema instead, so our Gateways can still start up, even if the schema is an old one.

Thank you!

@nogates
Copy link
Contributor Author

nogates commented Jan 27, 2022

BTW, I didn't mention it, but I'd be happy to work on this and submit a PR if that's ok with you folks :)

@cpeacock
Copy link
Contributor

Absolutely, we'd love to have you take a crack at it if you'd like! We did place this on a team's backlog but would love your contribution if you're able to give the time.

@trevor-scheer
Copy link
Member

Resolved in #1473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants