@@ -44,7 +44,9 @@ pub struct GroupStatus {
4444pub struct IncidentRecord {
4545 pub id : u32 ,
4646 pub message : String ,
47- pub timestamp : DateTime < Utc >
47+ pub timestamp : DateTime < Utc > ,
48+ pub error_message : Option < String > ,
49+ pub error_details : Option < String >
4850}
4951
5052pub struct MemoryStorage {
@@ -80,7 +82,9 @@ pub struct GroupSummaryItem {
8082pub struct IncidentItem {
8183 pub id : u32 ,
8284 pub message : String ,
83- pub timestamp : String
85+ pub timestamp : String ,
86+ pub error_message : Option < String > ,
87+ pub error_details : Option < String >
8488}
8589
8690impl MemoryStorage {
@@ -136,7 +140,9 @@ impl MemoryStorage {
136140 incidents. push ( IncidentItem {
137141 id : incident. id ,
138142 message : incident. message . clone ( ) ,
139- timestamp : incident. timestamp . to_rfc3339 ( )
143+ timestamp : incident. timestamp . to_rfc3339 ( ) ,
144+ error_message : incident. error_message . clone ( ) ,
145+ error_details : incident. error_details . clone ( )
140146 } )
141147 }
142148
@@ -150,7 +156,9 @@ impl MemoryStorage {
150156 . map ( |result| IncidentItem {
151157 id : result. id ,
152158 message : result. message . clone ( ) ,
153- timestamp : result. timestamp . to_rfc3339 ( )
159+ timestamp : result. timestamp . to_rfc3339 ( ) ,
160+ error_message : result. error_message . clone ( ) ,
161+ error_details : result. error_details . clone ( )
154162 } )
155163 }
156164
@@ -235,7 +243,9 @@ impl MemoryStorage {
235243 self . incidents . push ( IncidentRecord {
236244 id : self . last_incident_id ,
237245 message : format ! ( "Region {} is DOWN" , region) ,
238- timestamp : Utc :: now ( )
246+ timestamp : Utc :: now ( ) ,
247+ error_message : Some ( "Incident triggered at the region level" . to_string ( ) ) ,
248+ error_details : None
239249 } ) ;
240250 self . last_incident_id += 1 ;
241251
@@ -281,7 +291,9 @@ impl MemoryStorage {
281291 self . incidents . push ( IncidentRecord {
282292 id : self . last_incident_id ,
283293 message : format ! ( "Group {}.{} is DOWN" , region, group) ,
284- timestamp : Utc :: now ( )
294+ timestamp : Utc :: now ( ) ,
295+ error_message : Some ( "Incident triggered at the group level" . to_string ( ) ) ,
296+ error_details : None
285297 } ) ;
286298 self . last_incident_id += 1 ;
287299
0 commit comments