fix(presentation): log errors in diary export stream
This commit is contained in:
@@ -42,6 +42,7 @@ dotenvy = { workspace = true }
|
|||||||
uuid = { workspace = true }
|
uuid = { workspace = true }
|
||||||
chrono = { workspace = true }
|
chrono = { workspace = true }
|
||||||
async-trait = { workspace = true }
|
async-trait = { workspace = true }
|
||||||
|
futures = { workspace = true }
|
||||||
|
|
||||||
api-types = { workspace = true }
|
api-types = { workspace = true }
|
||||||
domain = { workspace = true, features = ["test-helpers"] }
|
domain = { workspace = true, features = ["test-helpers"] }
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use axum::{
|
|||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
response::{IntoResponse, Redirect},
|
response::{IntoResponse, Redirect},
|
||||||
};
|
};
|
||||||
|
use futures::StreamExt;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use application::diary::{
|
use application::diary::{
|
||||||
@@ -153,6 +154,12 @@ pub async fn export_diary(
|
|||||||
&state.app_ctx.services.diary_exporter,
|
&state.app_ctx.services.diary_exporter,
|
||||||
query,
|
query,
|
||||||
);
|
);
|
||||||
|
let stream = stream.map(|r| {
|
||||||
|
if let Err(ref e) = r {
|
||||||
|
tracing::error!("diary export stream error: {e}");
|
||||||
|
}
|
||||||
|
r
|
||||||
|
});
|
||||||
(
|
(
|
||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
[
|
[
|
||||||
@@ -313,6 +320,12 @@ pub async fn get_export_html(
|
|||||||
&state.app_ctx.services.diary_exporter,
|
&state.app_ctx.services.diary_exporter,
|
||||||
query,
|
query,
|
||||||
);
|
);
|
||||||
|
let stream = stream.map(|r| {
|
||||||
|
if let Err(ref e) = r {
|
||||||
|
tracing::error!("diary export stream error: {e}");
|
||||||
|
}
|
||||||
|
r
|
||||||
|
});
|
||||||
(
|
(
|
||||||
StatusCode::OK,
|
StatusCode::OK,
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user