You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: