diff --git a/src/app/states.rs b/src/app/states.rs index bcd4da40..d345682e 100644 --- a/src/app/states.rs +++ b/src/app/states.rs @@ -205,6 +205,8 @@ impl ProcWidgetState { self.process_search_state.search_state.error_message = None; } else { let parsed_query = self.parse_query(); + // debug!("PQ: {:?}", parsed_query); + if let Ok(parsed_query) = parsed_query { self.process_search_state.search_state.query = Some(parsed_query); self.process_search_state.search_state.is_blank_search = false; diff --git a/src/utils/error.rs b/src/utils/error.rs index 227635c3..5069cc78 100644 --- a/src/utils/error.rs +++ b/src/utils/error.rs @@ -104,6 +104,16 @@ impl From for BottomError { impl From for BottomError { fn from(err: regex::Error) -> Self { - BottomError::QueryError(err.to_string().into()) + // We only really want the last part of it... so we'll do it the ugly way: + let err_str = err.to_string(); + let error = err_str.split('\n').map(|s| s.trim()).collect::>(); + + BottomError::QueryError( + format!( + "Regex error: {}", + error.last().unwrap_or(&"".to_string().as_str()) + ) + .into(), + ) } }