Skip to content

Commit de5beef

Browse files
authored
Cleaner error message (#680)
* Cleaner error message
1 parent 9987b91 commit de5beef

File tree

1 file changed

+7
-3
lines changed
  • src-tauri/cli/src/bin

1 file changed

+7
-3
lines changed

src-tauri/cli/src/bin/dg.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,13 @@ async fn main() {
621621
.get_one::<Url>("url")
622622
.expect("No enrollment URL was provided or it's invalid");
623623
debug!("Successfully parsed enrollment token and URL");
624-
let config = enroll(url, token)
625-
.await
626-
.expect("The enrollment process has failed");
624+
let config = match enroll(url, token).await {
625+
Ok(cfg) => cfg,
626+
Err(err) => {
627+
error!("Enrollment process failed with error: {err}");
628+
return;
629+
}
630+
};
627631
debug!("Successfully enrolled the device, saving the configuration.");
628632
if let Err(err) = config.save(&config_path) {
629633
error!("{err}");

0 commit comments

Comments
 (0)