Verified Commit b04d1a32 authored by Mathias B.'s avatar Mathias B.
Browse files

Refactoring pour logger les messages d'erreur de Discord

parent 4322c6e5
......@@ -27,7 +27,7 @@ pub async fn get_message(path_params: web::Path<(u64, u64)>) -> Result<HttpRespo
let message = channel.id().
message(&client.http, message_id)
.await
.map_err(ClientError::from)?;
.map_err(log_and_convert)?;
Ok(HttpResponse::Ok().json(message))
}
......@@ -44,10 +44,7 @@ pub async fn send_message(path_params: web::Path<u64>, body: web::Json<SendMessa
let message = channel.id().send_message(&client.http, |builder| {
builder.content(&body.content)
}).await
.map_err(|e| {
tracing::error!("Error from Discord: {:#?}", e);
ClientError::from(e)
})?;
.map_err(log_and_convert)?;
Ok(HttpResponse::Ok().json(message))
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment