From 25d59d5b87621603f8e8c5753e9921c693ca9efd Mon Sep 17 00:00:00 2001 From: Dominic Grimm Date: Fri, 27 Jan 2023 18:35:43 +0100 Subject: [PATCH] Update --- src/lib.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7949c51..fa9371b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -742,6 +742,8 @@ impl Client { struct Data { finished: bool, error: bool, + #[serde(rename = "messageId")] + message_id: i32, #[serde(rename = "reportParams")] report_params: String, } @@ -768,7 +770,13 @@ impl Client { .await? .json() .await?; - dbg!(resp); + dbg!(&resp); + + if resp.error { + bail!("Error generating report"); + } else if !resp.finished { + bail!("Report not finished"); + } Ok(()) }