@@ -8,6 +8,7 @@ use crate::server::{Data, HttpError};
88use failure:: Compat ;
99use http:: { Response , StatusCode } ;
1010use hyper:: Body ;
11+ use std:: collections:: HashMap ;
1112use std:: sync:: Arc ;
1213use warp:: { self , Filter , Rejection } ;
1314
@@ -156,7 +157,11 @@ fn endpoint_heartbeat(data: Arc<Data>, auth: AuthDetails) -> Fallible<Response<B
156157 Ok ( ApiResponse :: Success { result : true } . into_response ( ) ?)
157158}
158159
159- fn endpoint_error ( error : String , data : Arc < Data > , auth : AuthDetails ) -> Fallible < Response < Body > > {
160+ fn endpoint_error (
161+ error : HashMap < String , String > ,
162+ data : Arc < Data > ,
163+ auth : AuthDetails ,
164+ ) -> Fallible < Response < Body > > {
160165 let ex = Experiment :: run_by ( & data. db , & Assignee :: Agent ( auth. name . clone ( ) ) ) ?
161166 . ok_or_else ( || err_msg ( "no experiment run by this agent" ) ) ?;
162167
@@ -165,11 +170,14 @@ fn endpoint_error(error: String, data: Arc<Data>, auth: AuthDetails) -> Fallible
165170 . line (
166171 "exclamation" ,
167172 format ! (
168- "Experiment **`{}`** ** running** on agent `{}` has encountered an error" ,
173+ "Experiment **`{}`** running on agent `{}` has encountered an error" ,
169174 ex. name, auth. name,
170175 ) ,
171176 )
172- . line ( "" , format ! ( "error: {}" , error, ) )
177+ . line (
178+ "sos" ,
179+ format ! ( "caused by: {}" , error. get( "error" ) . unwrap( ) , ) ,
180+ )
173181 . send ( & github_issue. api_url , & data) ?;
174182 }
175183 Ok ( ApiResponse :: Success { result : true } . into_response ( ) ?)
0 commit comments