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

registry.get_method should raise an exception #725

Merged
merged 1 commit into from
May 24, 2024

Conversation

moggers87
Copy link
Collaborator

Description

registry.get_method has been changed to raise an exception, MethodNotFoundError, when it encounters a unregistered method.

Motivation and Context

Returning None makes it more difficult to track down cases where an unregistered method has been used as it results in an unhelpful error such as reported in #717

How Has This Been Tested?

A new test has been added and old tests have been updated.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Returning None makes it more difficult to track down cases where
an unregistered method has been used as it results in an unhelpful error
such as reported in jazzband#717
@moggers87 moggers87 marked this pull request as ready for review May 23, 2024 22:25
Copy link
Contributor

@claudep claudep left a comment

Choose a reason for hiding this comment

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

Thanks looks good and more "pythonic"!

@moggers87 moggers87 merged commit 8bcfc21 into jazzband:master May 24, 2024
7 checks passed
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