diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-12-18 20:55:49 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-12-18 20:55:49 +0100 |
commit | 2eca6515518ec365d129d120629d2dae2a4f6a43 (patch) | |
tree | dbf0f42c1fd00458aaf701514dc63e6725d3638b /gui | |
parent | ea43c40d966c277ab0451a5f0ca3dd4dae3a8fc9 (diff) |
Add error message when distrox fails to load
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'gui')
-rw-r--r-- | gui/src/app/message.rs | 2 | ||||
-rw-r--r-- | gui/src/app/mod.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gui/src/app/message.rs b/gui/src/app/message.rs index a357d8e..f530774 100644 --- a/gui/src/app/message.rs +++ b/gui/src/app/message.rs @@ -8,7 +8,7 @@ use distrox_lib::types::Payload; #[derive(Debug, Clone)] pub enum Message { Loaded(Arc<Profile>), - FailedToLoad, + FailedToLoad(String), InputChanged(String), CreatePost, diff --git a/gui/src/app/mod.rs b/gui/src/app/mod.rs index 450744e..a6849fb 100644 --- a/gui/src/app/mod.rs +++ b/gui/src/app/mod.rs @@ -42,7 +42,7 @@ impl Application for Distrox { Distrox::Loading, iced::Command::perform(async move { match Profile::load(&name).await { - Err(_) => Message::FailedToLoad, + Err(e) => Message::FailedToLoad(e.to_string()), Ok(instance) => { Message::Loaded(Arc::new(instance)) } @@ -69,8 +69,8 @@ impl Application for Distrox { }; } - Message::FailedToLoad => { - log::error!("Failed to load"); + Message::FailedToLoad(e) => { + log::error!("Failed to load: {}", e); *self = Distrox::FailedToStart; } |