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

refactor: hamilton.exceptions #1181

Open
zilto opened this issue Oct 15, 2024 · 0 comments
Open

refactor: hamilton.exceptions #1181

zilto opened this issue Oct 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@zilto
Copy link
Collaborator

zilto commented Oct 15, 2024

Given the increasing complexity of the library, it could be valuable to create custom exceptions rather than generic ValueError and KeyError.

This helps with:

  • readability: the name of the exception is informative EdgeTypeMismatchException, UnknownNodeException, MaterializationError
  • maintainability: the exceptions can be gradually improved by modifying the message in a central place instead of attaching custom messages to individual KeyError around the codebase
  • debugging: maintainers and users can make a better use of the debugger and exception handling to debug and test their code

related:

@zilto zilto added the enhancement New feature or request label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant