diff options
| author | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-06 17:23:00 +0000 |
|---|---|---|
| committer | Brooks J Rady <b.j.rady@gmail.com> | 2021-01-06 17:23:00 +0000 |
| commit | 698bcf83fc041637191ae7ef92fdeb3a5acb14b8 (patch) | |
| tree | 28a0c33f6d4eb94080cdcbc57ebcae08462dad1f /src/errors.rs | |
| parent | Fix early quit with plugins (diff) | |
| download | sl0ppij-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.rs | 13 |
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"); |
