@@ -8,6 +8,7 @@ use crate::server::{Data, HttpError};
8
8
use failure:: Compat ;
9
9
use http:: { Response , StatusCode } ;
10
10
use hyper:: Body ;
11
+ use std:: collections:: HashMap ;
11
12
use std:: sync:: Arc ;
12
13
use warp:: { self , Filter , Rejection } ;
13
14
@@ -156,7 +157,11 @@ fn endpoint_heartbeat(data: Arc<Data>, auth: AuthDetails) -> Fallible<Response<B
156
157
Ok ( ApiResponse :: Success { result : true } . into_response ( ) ?)
157
158
}
158
159
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 > > {
160
165
let ex = Experiment :: run_by ( & data. db , & Assignee :: Agent ( auth. name . clone ( ) ) ) ?
161
166
. ok_or_else ( || err_msg ( "no experiment run by this agent" ) ) ?;
162
167
@@ -165,11 +170,14 @@ fn endpoint_error(error: String, data: Arc<Data>, auth: AuthDetails) -> Fallible
165
170
. line (
166
171
"exclamation" ,
167
172
format ! (
168
- "Experiment **`{}`** ** running** on agent `{}` has encountered an error" ,
173
+ "Experiment **`{}`** running on agent `{}` has encountered an error" ,
169
174
ex. name, auth. name,
170
175
) ,
171
176
)
172
- . line ( "" , format ! ( "error: {}" , error, ) )
177
+ . line (
178
+ "sos" ,
179
+ format ! ( "caused by: {}" , error. get( "error" ) . unwrap( ) , ) ,
180
+ )
173
181
. send ( & github_issue. api_url , & data) ?;
174
182
}
175
183
Ok ( ApiResponse :: Success { result : true } . into_response ( ) ?)
0 commit comments