mirror of
https://git.42l.fr/neil/sncf.git
synced 2024-05-25 11:52:14 +02:00
more debug info when NC returns bad status code
This commit is contained in:
parent
5014e79b06
commit
be19e37cb7
|
@ -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"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue