diff --git a/src-tauri/cli/src/bin/dg.rs b/src-tauri/cli/src/bin/dg.rs index 6e026c94..d1ea1d80 100644 --- a/src-tauri/cli/src/bin/dg.rs +++ b/src-tauri/cli/src/bin/dg.rs @@ -621,9 +621,13 @@ async fn main() { .get_one::("url") .expect("No enrollment URL was provided or it's invalid"); debug!("Successfully parsed enrollment token and URL"); - let config = enroll(url, token) - .await - .expect("The enrollment process has failed"); + let config = match enroll(url, token).await { + Ok(cfg) => cfg, + Err(err) => { + error!("Enrollment process failed with error: {err}"); + return; + } + }; debug!("Successfully enrolled the device, saving the configuration."); if let Err(err) = config.save(&config_path) { error!("{err}");