Skip to content

Commit

Permalink
fix(error_handling): provide more information
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Nov 22, 2023
1 parent cdaa11e commit 75b6099
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/utils/error_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down Expand Up @@ -107,7 +111,7 @@ impl ValfiskError<'_> {
.color(0xef4444)
.field(
"Command",
format!("`{}`", self.ctx.invoked_command_name()),
format!("`{}`", self.ctx.invocation_string()),
false,
)
.field(
Expand Down

0 comments on commit 75b6099

Please sign in to comment.