From eb0a092fc53964e02a09da2d92a1f8a3042a1360 Mon Sep 17 00:00:00 2001 From: fx Date: Thu, 19 Oct 2023 09:39:28 +0200 Subject: added error message on server != 200 --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index d2f0c3a..e6ca3ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use config::SETTINGS; use error::CliError; use requests::{start::start, get::get}; use reqwest::header::{HeaderMap, HeaderValue}; +use serde::Deserialize; mod config; mod error; @@ -58,3 +59,8 @@ fn default_headers() -> Result { Ok(map) } + +#[derive(Debug, Deserialize)] +struct ErrorResponse { + error: String +} -- cgit v1.2.3