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

Create specific error class to signal uplink fetcher errors #1473

Conversation

nogates
Copy link
Contributor

@nogates nogates commented Feb 3, 2022

Hello there,

As described in #1439, we are suggesting here to use a specific class when throwing errors while fetching the schema from Apollo Uplink.

This should allow us to capture those errors using the specific class name, instead of relying on the actual message.

I've decided to transform all the errors in that file (since they are all related to the same process of fetching the schema). Also, please let me know if you think the error class should be placed somewhere else, so we don't need to export it up to the top

Thank you!

Fixes

@apollo-cla
Copy link

@nogates: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 3, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Thanks for the changes! Can you please add an entry to the gateway-js/CHANGELOG.md? We'll port this to the version-0.x branch when this lands.

cc @cpeacock for awareness since you participated on the linked issue - sounds like there might be an Atlas issue we can close out when this lands?

@nogates
Copy link
Contributor Author

nogates commented Feb 7, 2022

This LGTM. Thanks for the changes! Can you please add an entry to the gateway-js/CHANGELOG.md? We'll port this to the version-0.x branch when this lands.

Done! :)

@trevor-scheer trevor-scheer added the ↪️ backport-to-0.x landed on 2.x, but needs to be backported to the 0.x series label Feb 8, 2022
@cpeacock
Copy link
Contributor

cpeacock commented Feb 9, 2022

pinging @clenfest for awareness

@trevor-scheer trevor-scheer merged commit bc8e670 into apollographql:main Feb 9, 2022
trevor-scheer added a commit that referenced this pull request Feb 9, 2022
Create specific error class to signal uplink fetcher errors (backport #1473) (`version-0.x`)
@nogates nogates deleted the nogates/use-typed-errors-when-apollo-is-down branch February 10, 2022 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
↪️ backport-to-0.x landed on 2.x, but needs to be backported to the 0.x series
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants