Actions
Bug #123
openrefactor exceptions to avoid superfluous message attribute
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/26/2026
Due date:
% Done:
0%
Estimated time:
Engineering Effort:
medium
App Component:
Database
Feature:
Description
We have a bunch of exceptions that make use of a superfluous "message" attribute:
class TaskValidationError(ValidationError):
def __init__(self, message: str):
self.message = message
super().__init__(message)
This is unnecessary. Exceptions store their message in arg[0] and you can just do str(e) to fetch them.
You can just do this:
raise ValidationError(f"Remote calendar {remote_uid} not found.")
And then later:
return jsonify({"error": str(e)}), 401
We should replace all instances of e.message with str(e), and then remove the class definition for exceptions entirely (unless some of them have something other than saving a "message" attribute.
Actions