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

Update error handeling #69

Open
2 tasks
elYanuki opened this issue Dec 22, 2023 · 1 comment
Open
2 tasks

Update error handeling #69

elYanuki opened this issue Dec 22, 2023 · 1 comment
Assignees

Comments

@elYanuki
Copy link
Contributor

elYanuki commented Dec 22, 2023

The main problem is that we sometimes catch for (Exception ex), this also includes a CCException.

when this generic catch surrounds another method such as a getById or anything else that can throw a CCException: we essentially loose that information that the id was wrong and just throw the less detailed exception thats listed in the catch clause.

  • practically no catch() block should catch for a generic Exception but for something like a NumberFormatException. Possibly multiple try catch blocks are necessary, these can then throw different CCExceptions which make the errors nicer
  • more descriptive exceptions and errors should be added to all the update methods.. for example when a teacher reuqests a confirmation email and the student is not set you get an error instead of a nice CCResponse
@Michiii11 Michiii11 self-assigned this Mar 1, 2024
Michiii11 added a commit that referenced this issue Mar 5, 2024
@elYanuki
Copy link
Contributor Author

this is not fully complete, classes such as in the devicetypeRepository still have dangerous generic catches (ones that contain antother function that can throw a CCException) But in the name of clean code: almost every catch should be a specific exception

@stevan06v stevan06v added this to the Oasch milestone Mar 18, 2024
@elYanuki elYanuki removed this from the Oasch milestone Mar 24, 2024
@elYanuki elYanuki assigned DrSteini and unassigned Michiii11 Mar 24, 2024
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

No branches or pull requests

4 participants