-
Notifications
You must be signed in to change notification settings - Fork 1
Add meaningful exception handling, report errors #38
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive exception handling to the ServiceX DID finder library. It introduces a new error reporting mechanism and creates specific exception types for different failure scenarios.
- Introduces new custom exception types for specific DID finding failures
- Adds error reporting to ServiceX through a new
/error
endpoint - Updates the main DID finder task to catch exceptions and report them appropriately
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/servicex_did_finder_lib/exceptions.py | Defines new exception hierarchy with specific error types for DID finding failures |
src/servicex_did_finder_lib/servicex_adaptor.py | Adds new put_fileset_error method and convenience put_file_add method |
src/servicex_did_finder_lib/did_finder_app.py | Updates exception handling to catch and report errors via new error endpoint |
src/servicex_did_finder_lib/communication.py | Updates type hint for UserDIDHandler return type |
tests/servicex_did_finder_lib_tests/test_servicex_adaptor.py | Adds tests for the new error reporting functionality |
tests/servicex_did_finder_lib_tests/test_did_finder_app.py | Updates tests to cover new exception handling behavior |
fd918ac
to
3a40ce3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems great - the one comment I had was the retry was coded instead of using a well tested library.
def put_fileset_error(self, summary): | ||
success = False | ||
attempts = 0 | ||
while not success and attempts < MAX_RETRIES: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be using a retry decorator instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but if prefer to do that coherently with the other function in another PR.
Call a new ServiceX endpoint if the DID finder throws an exception. Provide some exceptions to cover use cases.