From 1c176d4f7338cb6c98831533a14b7391bce76481 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 25 Nov 2024 17:42:26 +0000 Subject: [PATCH] dbg: excessive logging --- src/lib.rs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8508657..4738d2c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +use std::num::ParseIntError; use serde::{Deserialize, Serialize}; // This is what Wolves returns to us @@ -201,6 +202,7 @@ impl Client { /// # }) /// ``` pub async fn get_member(self, email: &str) -> Option { + dbg!(&self.base_key); // if the key isnt set then we cant do anything. let api_key = match &self.base_key { None => { @@ -210,7 +212,7 @@ impl Client { }; let url = format!("{}/get_id_from_email", &self.base_wolves); - + dbg!(&url); match reqwest::Client::new() .post(&url) .form(&[("email", email)]) @@ -219,13 +221,26 @@ impl Client { .await { Ok(x) => { - if let Ok(y) = x.json::>().await { - // this is the only time we will get a positive response, the None at the end catches everything else - if let WolvesUserExists::S(z) = y.result { - if let Ok(id) = z.parse::() { - return Some(id); + match x.json::>().await { + Ok(y) => { + // this is the only time we will get a positive response, the None at the end catches everything else + match y.result { + WolvesUserExists::B(e) => {dbg!(e);} + WolvesUserExists::S(z) => { + match z.parse::() { + Ok(id) => { + return Some(id); + } + Err(e) => { + dbg!(e); + } + } + } } } + Err(e) => { + dbg!(e); + } } } Err(e) => {