Skip to content

Commit

Permalink
Show full error trace on submit action
Browse files Browse the repository at this point in the history
  • Loading branch information
azat committed Oct 23, 2023
1 parent c4e9ac4 commit f6165ce
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/view/navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,19 +773,23 @@ impl Navigation for Cursive {
"name",
"value",
"last_error_time error_time",
// TODO: on_submit show:
// - last_error_message
// - last_error_trace
"last_error_message _error_message",
"arrayStringConcat(arrayMap(addr -> concat(addressToLine(addr), '::', demangle(addressToSymbol(addr))), last_error_trace), '\n') _error_trace",
];

// TODO: on submit show logs from system.query_log/system.text_log, but we need to
// implement wrapping before
self.show_query_result_view(
context,
table,
None,
"value",
&mut columns,
QUERY_RESULT_VIEW_NOP_CALLBACK,
&HashMap::new(),
Some(|siv: &mut Cursive, row: view::QueryResultRow| {
let trace = row.0.iter().last().unwrap();
siv.add_layer(Dialog::info(trace.to_string()).title("Error trace"));
}),
&HashMap::from([("allow_introspection_functions", "1")]),
);
}

Expand Down

0 comments on commit f6165ce

Please sign in to comment.