diff options
| author | Nathan Perry <avaglir@gmail.com> | 2019-03-03 12:22:22 -0500 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2019-03-03 12:22:22 -0500 |
| commit | e9e683d0030d9a459ecd6183c8250d0dc42662ef (patch) | |
| tree | bea0023d05279ff47ad4d936e163f4083c5826c6 /src/main.rs | |
| parent | a597151e2086e12814fea12abe1a4c31d0ca1f7f (diff) | |
improve error handling
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 044e6cf..1116b1f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,12 +107,16 @@ fn run() -> Result<()> { result }) - .after(|_ctx, _msg, cmd, err| { + .after(|_ctx, msg, cmd, err| { match err { Ok(()) => { trace!("command '{}' completed successfully", cmd); }, Err(e) => { + if let Err(e) = crate::commands::send(msg.channel_id, "BANIC", msg.tts) { + error!("sending BANIC: {}", e); + } + error!("error encountered handling command '{}': {:?}", cmd, e); } } |
