fix: show me what they say when rejecting sign :(
This commit is contained in:
parent
a2f77fa6fb
commit
f2513f30c8
1 changed files with 9 additions and 5 deletions
|
@ -147,11 +147,15 @@ async fn deliver(key: &PKey<Private>, to: &str, from: &str, payload: serde_json:
|
||||||
.header(USER_AGENT, format!("upub+{VERSION} ({domain})")) // TODO put instance admin email
|
.header(USER_AGENT, format!("upub+{VERSION} ({domain})")) // TODO put instance admin email
|
||||||
.body(payload)
|
.body(payload)
|
||||||
.send()
|
.send()
|
||||||
.await?
|
|
||||||
.error_for_status()?
|
|
||||||
.text()
|
|
||||||
.await?;
|
.await?;
|
||||||
tracing::info!("server answered with OK '{res}'");
|
|
||||||
|
let status = res.status();
|
||||||
|
let txt = res.text().await?;
|
||||||
|
tracing::info!("delivery answer: {txt}");
|
||||||
|
if status.is_client_error() || status.is_server_error() {
|
||||||
|
Err(UpubError::Status(axum::http::StatusCode::from_u16(status.as_u16()).unwrap()))
|
||||||
|
} else {
|
||||||
Ok(())
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue