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

remove try/except from add_subscription #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FlorianLudwig
Copy link
Member

@FlorianLudwig FlorianLudwig commented May 3, 2021

DISCLAIMER: I do not understand why this was there in the first place.

I am sure there is (or was) a good reason.

The issue is, the "try" block is way to big and covers a lot code with a rather broad exception - catching exceptions that should not. This is part of the problem why we didn't notice #60 earlier, as we would have got:

  File "amqtt/plugins/topic_checking.py", line 73, in topic_filtering
    allowed_topics = self.topic_config["acl"].get(username, None)
KeyError: 'acl'

As the diff is a bit hard to read on github: I just removed the try/except

@FlorianLudwig FlorianLudwig marked this pull request as draft May 3, 2021 19:23
Copy link
Contributor

@HerrMuellerluedenscheid HerrMuellerluedenscheid left a comment

Choose a reason for hiding this comment

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

Oh yeah that looks bad. Good to remove it and if problems occurr to catch them more selectively. It's still marked draft but I think this is reasonable the way it is. Also none of the tests fail.

@FlorianLudwig
Copy link
Member Author

None of the tests fail,... but the test coverage on that part is a bit sketchy as we didn't catch the error that the most basic version of our mqtt server broke 😓

See also #43 (comment) ;P

@not-f-elsner
Copy link
Collaborator

LGTM

@FlorianLudwig FlorianLudwig marked this pull request as ready for review February 14, 2023 17:48
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.

3 participants