aboutsummaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-01-06 17:23:00 +0000
committerBrooks J Rady <b.j.rady@gmail.com>2021-01-06 17:23:00 +0000
commit698bcf83fc041637191ae7ef92fdeb3a5acb14b8 (patch)
tree28a0c33f6d4eb94080cdcbc57ebcae08462dad1f /src/errors.rs
parentFix early quit with plugins (diff)
downloadsl0ppij-698bcf83fc041637191ae7ef92fdeb3a5acb14b8.tar.gz
sl0ppij-698bcf83fc041637191ae7ef92fdeb3a5acb14b8.tar.xz
sl0ppij-698bcf83fc041637191ae7ef92fdeb3a5acb14b8.zip
Warnings purged and some FIXME's addressed
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 148d7119..92ea7a41 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -1,17 +1,22 @@
use crate::pty_bus::PtyInstruction;
use crate::screen::ScreenInstruction;
-use crate::{AppInstruction, SenderWithContext, OPENCALLS};
-use backtrace::Backtrace;
+use crate::{AppInstruction, OPENCALLS};
+
use std::fmt::{Display, Error, Formatter};
-use std::panic::PanicInfo;
-use std::{process, thread};
const MAX_THREAD_CALL_STACK: usize = 6;
+#[cfg(not(test))]
+use crate::SenderWithContext;
+#[cfg(not(test))]
+use std::panic::PanicInfo;
+#[cfg(not(test))]
pub fn handle_panic(
info: &PanicInfo<'_>,
send_app_instructions: &SenderWithContext<AppInstruction>,
) {
+ use backtrace::Backtrace;
+ use std::{process, thread};
let backtrace = Backtrace::new();
let thread = thread::current();
let thread = thread.name().unwrap_or("unnamed");