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] PoC for centralised exception handling #1525

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alex-harvey-z3q
Copy link
Contributor

@alex-harvey-z3q alex-harvey-z3q commented Oct 6, 2024

Proof of concept for centralised exception handling.

See also #1522

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

Copy link
Contributor

@zaro0508 zaro0508 left a comment

Choose a reason for hiding this comment

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

I think handling in connection manager seems like the right place therefore i think i prefer this over PR #1522. However instead of using this approach how about we switch to a cleaner approach using aws-error-utils which i found here https://stackoverflow.com/a/33663484

@@ -463,8 +468,21 @@ def call(
if kwargs is None: # pragma: no cover
kwargs = {}

client = self._get_client(service, region, profile, stack_name, sceptre_role)
return getattr(client, command)(**kwargs)
# Centralised exception handling where he catch some confusing errors from the Boto3
Copy link
Contributor

Choose a reason for hiding this comment

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

he/we?

@alex-harvey-z3q
Copy link
Contributor Author

I think handling in connection manager seems like the right place therefore i think i prefer this over PR #1522. However instead of using this approach how about we switch to a cleaner approach using aws-error-utils which i found here https://stackoverflow.com/a/33663484

I am not sure I like that idea, as it introduces a dependency on a third party project and, by the looks of it, has not been committed to in over a year
https://github.com/benkehoe/aws-error-utils

I agree with you that handling all of these exceptions is going to lead to some bloat and we may eventually need another helper method but I think we'll figure it out and keep the code clean?

@alex-harvey-z3q
Copy link
Contributor Author

What do you think @dboitnot ?

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.

2 participants