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 function from module in the backend to catch errors and raise custom exceptions #61

Closed
2 of 4 tasks
MaxenceGui opened this issue Mar 6, 2024 · 0 comments · Fixed by #82
Closed
2 of 4 tasks
Assignees
Labels
good first issue Good for newcomers

Comments

@MaxenceGui
Copy link

MaxenceGui commented Mar 6, 2024

Issue Description

At present, several backend functions are not optimally handling exceptions. Some of them return False when they catch an exception, while others use the generic type Exception to catch all possible errors, which is not a good practice as it can hide critical errors that the team needs to address. Additionally, some custom exceptions are being attempted to be caught but are never raised in the first place.

Concerned module:

  • azure_storage
  • model_inference
    • inference.py
    • model_module.py
  • model_request
  • app.py

Excluding pipelines_version_insertion.py as another issue is specific to this case

Work to do

Refactor the backend to handle exceptions as per Python standards and provide meaningful error messages.

Acceptance Criteria

  • No more generic exceptions are caught or raised unless it is required (avoid server crash for example)
  • When errors are caught in a module, the custom exception is raised with the from keyword when necessary

Tasks

  • Modify the azure_storage module to eliminate every return False from catching exception; raise a custom exception instead
  • Modify the model_inference module to catch specific exceptions and return the ProcessInferenceResultError custom error
  • Raise a custom exception in model_request if the deployment platform of a model is not supported
  • Modify app.py to handle exceptions raised by the module it is using
@MaxenceGui MaxenceGui added this to the M1 (2024 February) milestone Mar 6, 2024
@MaxenceGui MaxenceGui self-assigned this Mar 6, 2024
@MaxenceGui MaxenceGui added this to Nachet Mar 6, 2024
@MaxenceGui MaxenceGui moved this to Todo in Nachet Mar 6, 2024
@MaxenceGui MaxenceGui removed their assignment Mar 12, 2024
@MaxenceGui MaxenceGui added the good first issue Good for newcomers label Apr 22, 2024
@sylvanie85 sylvanie85 self-assigned this May 13, 2024
@sylvanie85 sylvanie85 moved this from Todo to In Progress in Nachet May 13, 2024
@Francois-Werbrouck Francois-Werbrouck linked a pull request May 15, 2024 that will close this issue
@Francois-Werbrouck Francois-Werbrouck moved this from In Progress to Waiting on Review in Nachet May 15, 2024
@github-project-automation github-project-automation bot moved this from Waiting on Review to Done in Nachet May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants