From 8b3e6a8380125c38cb2dc79c21836dfe69284c75 Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 14 Aug 2023 22:55:15 +0200 Subject: [PATCH] Add non-panicy error handling for local pins --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index bf7e04d..e80781e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -141,7 +141,10 @@ impl Bot { auth: self.auth.clone() }; - let _ = self.pin(remove_local_pin); + match self.pin(remove_local_pin) { + Ok(_) => {}, + Err(e) => println!("Error Unpinning Post: {:#?}", e) + }; } } @@ -161,7 +164,10 @@ impl Bot { auth: self.auth.clone(), }; - let _ = self.pin(pin_new_local); + match self.pin(pin_new_local) { + Ok(_) => {}, + Err(e) => println!("Error Pinning Post: {:#?}", e) + };; return Ok(()); }