1
0
Fork 0
mirror of https://git.42l.fr/neil/sncf.git synced 2024-05-11 02:06:34 +02:00

more debug info when NC returns bad status code

This commit is contained in:
bleh 2020-08-22 12:05:23 +02:00
parent 5014e79b06
commit be19e37cb7

View file

@ -77,6 +77,12 @@ pub async fn create_account(
// only 200 http status code is allowed
if register_query.status() != 200 {
eprintln!("error_createaccount_status: {}", register_query.status());
// + extract response body for debugging purposes
let response_body = register_query.body().await.map_err(|e| {
eprintln!("error_createaccount_post_body: {}", e);
crash(lang.clone(), "error_createaccount_post_body")
})?;
debug(&format!("Body: {:#?}", response_body));
return Err(crash(lang.clone(), "error_createaccount_status"));
}