From 1d5749bda91269ef988ce9d92b2a06a43414b977 Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 9 Sep 2023 17:35:56 +0200 Subject: [PATCH] better unwrap message when following cell path in `ui.rs` --- src/ui.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui.rs b/src/ui.rs index 50e48c9..99cc535 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -249,7 +249,13 @@ fn render_data(frame: &mut Frame<'_, B>, app: &App, config: &Config) .value .clone() .follow_cell_path(&data_path, false) - .expect("unexpected error when following cell path during rendering"); + .unwrap_or_else(|_| { + panic!( + "unexpected error when following {:?} in {}", + app.position.members, + app.value.into_string(" ", &nu_protocol::Config::default()) + ) + }); let normal_name_style = Style::default() .fg(config.colors.normal.name.foreground)