Print error if one occurs during process invoked by API call

This commit is contained in:
binarybaron 2023-11-09 14:32:16 +01:00
parent b51b0e02d6
commit ca149d2faa

View file

@ -803,7 +803,12 @@ impl Request {
pub async fn call(self, context: Arc<Context>) -> Result<serde_json::Value> {
let method_span = self.cmd.get_tracing_span(self.log_reference.clone());
self.handle_cmd(context).instrument(method_span).await
self.handle_cmd(context).instrument(method_span.clone()).await.map_err(|err| {
method_span.in_scope(|| {
tracing::debug!(%err, "API call resulted in an error");
});
err
})
}
}