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

[Resolve #1519] Improve error message #1522

Closed
wants to merge 4 commits into from

Conversation

dboitnot
Copy link
Contributor

@dboitnot dboitnot commented Oct 3, 2024

Resolves #1519 by:

  • Raising un-handled exceptions which (I believe) should be the default behavior.
  • Detecting ForbiddenException and wrapping it in a more informative message

PR Checklist

  • Wrote a good commit message & description [see guide below].
  • Commit message starts with [Resolve #issue-number].
  • Added/Updated unit tests.
  • Added/Updated integration tests (if applicable).
  • All unit tests (poetry run tox) are passing.
  • Used the same coding conventions as the rest of the project.
  • The new code passes pre-commit validations (poetry run pre-commit run --all-files).
  • The PR relates to only one subject with a clear title.
    and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • Before merge squash related commits.

Other Information

Guide to writing a good commit

@alex-harvey-z3q
Copy link
Contributor

In general I am a bit concerned that while I support the general idea, the implementation here just will not scale to the handling of all exceptions in all places in the code and will not therefore be maintainable. E.g. the PR suggests we handle ForbiddenException but what about ExpiredTokenException and NoCredentialsError and every possible other exception the client can throw if you haven't set up your AWS config properly?

I wonder if you should start by reviewing this much earlier PR
#997

@dboitnot
Copy link
Contributor Author

dboitnot commented Oct 4, 2024

In general I am a bit concerned that while I support the general idea, the implementation here just will not scale to the handling of all exceptions in all places in the code and will not therefore be maintainable.

I completely agree that this is addressing a narrow case and that a more general solution is needed. I would argue that:

  1. The original implementation was broken, returning None when it should have raised the exception.
  2. We needn't let perfect be the enemy of good. This PR fixes the bug and addresses an additional case which is affecting real users.
  3. Misleading error messages are expensive and permissions issues are common.

C'mon, it's been forever since I submitted a PR. 😆

@alex-harvey-z3q alex-harvey-z3q changed the title Resolve 1519 - Improved error message [Resolve #1519] Improve error message Oct 5, 2024
@alex-harvey-z3q
Copy link
Contributor

alex-harvey-z3q commented Oct 5, 2024

@dboitnot Here are some more thoughts:

@alex-harvey-z3q
Copy link
Contributor

Closing in favour of #1530

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