diff --git a/src/mattermost.rs b/src/mattermost.rs index 1eb100a..69f1890 100644 --- a/src/mattermost.rs +++ b/src/mattermost.rs @@ -5,7 +5,14 @@ pub async fn connexion(token: &str, url: &str) { let auth = AuthenticationData::from_access_token(&token); let mut api = Mattermost::new(url, auth); api.store_session_token().await.unwrap(); - let team_info = api.get_team_info("etudiant-es").await.unwrap(); + let team_info = api.get_team_info("etudiant-es").await; - println!("{:?}", team_info); + match team_info { + Ok(infos) => { + println!("Information sur la team : {:?}", infos); + } + Err(e) => { + println!("Error: {}", e); + } + } }