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

fix(appstore-connect): Return more detailed errors when API credentials are unusable during setup #29808

Merged
merged 2 commits into from
Nov 9, 2021

Conversation

relaxolotl
Copy link
Contributor

@relaxolotl relaxolotl commented Nov 5, 2021

When setting up credentials the only feedback that's returned when they're wrong (invalid, not enough perms) is this:

Screenshot 2021-11-03 at 10 08 20 PM

This changes things so that the user will see the following two errors instead based on what App Store Connect tells us:

Screenshot 2021-11-04 at 12 13 46 AM

Screenshot 2021-11-04 at 12 14 31 AM

Front end work was already completed as a part of #29728 since there's some shared FE code between these two PRs.

I don't believe there should be any issues deploying this change as the FE already is capable of handling what this endpoint returns prior to and after this change.

@relaxolotl relaxolotl requested a review from a team November 5, 2021 00:20
@relaxolotl
Copy link
Contributor Author

@priscilawebdev heads up that this doesn't make any changes to the FE, but a previously partially unused case in the FE will now be used once these changes are in.

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

Nice!

try:
apps = appstore_connect.get_apps(session, credentials)
except appstore_connect.UnauthorizedError:
raise AppConnectAuthenticationError()
Copy link
Contributor

Choose a reason for hiding this comment

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

python oddity, you don't actually have to instantiate the class you want to "raise". If you pass a type to raise it will instantiate it for you. But there's no harm in doing this either so doesn't really matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is probably the second or third time i've done this in a PR, thanks for pointing this out 🙃

@relaxolotl relaxolotl force-pushed the appconnect/extended-validate branch from 142c12d to 1e7fa19 Compare November 9, 2021 01:45
@relaxolotl relaxolotl requested a review from a team as a code owner November 9, 2021 01:45
@relaxolotl relaxolotl force-pushed the appconnect/credentials-setup-errors branch from 0f90a60 to d154ad1 Compare November 9, 2021 01:57
Base automatically changed from appconnect/extended-validate to master November 9, 2021 15:17
@relaxolotl relaxolotl force-pushed the appconnect/credentials-setup-errors branch from d154ad1 to e2a683a Compare November 9, 2021 16:01
@relaxolotl relaxolotl enabled auto-merge (squash) November 9, 2021 16:03
@relaxolotl relaxolotl merged commit d6378d5 into master Nov 9, 2021
@relaxolotl relaxolotl deleted the appconnect/credentials-setup-errors branch November 9, 2021 16:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants