From 75b6099e3aa0f59aad5b617281bed6ca6876cc6b Mon Sep 17 00:00:00 2001 From: Ryan Cao <70191398+ryanccn@users.noreply.github.com> Date: Wed, 22 Nov 2023 23:50:53 +0800 Subject: [PATCH] fix(error_handling): provide more information --- src/utils/error_handling.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/utils/error_handling.rs b/src/utils/error_handling.rs index 3f1d8e9..fec1f41 100644 --- a/src/utils/error_handling.rs +++ b/src/utils/error_handling.rs @@ -64,12 +64,16 @@ impl ValfiskError<'_> { /// Log the error to the console. pub fn handle_log(&self) { eprintln!( - "{}\n {} {}\n {} {}\n{:#?}", + "{}\n {} {}\n {} {}\n {} {}\n {} {}\n{:#?}", format!("Encountered {}!", self.error_or_panic.type_string()).red(), "ID:".dimmed(), self.error_id, "Command:".dimmed(), - self.ctx.invoked_command_name(), + self.ctx.invocation_string(), + "Channel:".dimmed(), + self.ctx.channel_id().get(), + "User:".dimmed(), + self.ctx.author().id, self.error_or_panic ); } @@ -107,7 +111,7 @@ impl ValfiskError<'_> { .color(0xef4444) .field( "Command", - format!("`{}`", self.ctx.invoked_command_name()), + format!("`{}`", self.ctx.invocation_string()), false, ) .field(