ciyidogan commited on
Commit
017e57f
·
verified ·
1 Parent(s): bbc337b

Update exceptions.py

Browse files
Files changed (1) hide show
  1. exceptions.py +9 -0
exceptions.py CHANGED
@@ -44,6 +44,15 @@ class RaceConditionError(FlareException):
44
  self.current_user = current_user
45
  self.last_update_user = last_update_user
46
  self.last_update_date = last_update_date
 
 
 
 
 
 
 
 
 
47
 
48
  class ConfigurationError(FlareException):
49
  """Raised when there's a configuration issue"""
 
44
  self.current_user = current_user
45
  self.last_update_user = last_update_user
46
  self.last_update_date = last_update_date
47
+
48
+ def to_http_detail(self) -> Dict[str, Any]:
49
+ """Convert to HTTPException detail format with proper serialization"""
50
+ return {
51
+ "message": self.message,
52
+ "last_update_user": self.last_update_user,
53
+ "last_update_date": self.last_update_date.isoformat() if isinstance(self.last_update_date, datetime) else self.last_update_date,
54
+ "type": "race_condition"
55
+ }
56
 
57
  class ConfigurationError(FlareException):
58
  """Raised when there's a configuration issue"""