less fragile backtrace parsing

This commit is contained in:
Robin Appelman 2025-05-26 18:59:37 +02:00
commit 768c56c447
2 changed files with 3 additions and 2 deletions

View file

@ -267,7 +267,7 @@ impl FullException {
pub struct Trace {
#[serde(default)]
pub file: String,
pub line: LineNumber,
pub line: Option<LineNumber>,
pub function: String,
#[serde(default)]
pub class: String,

View file

@ -142,7 +142,8 @@ fn trace_line(trace: &Trace, path_prefix_length: usize) -> Row {
.get(path_prefix_length..)
.unwrap_or_default(),
),
Text::from(trace.line.to_string()).alignment(Alignment::Right),
Text::from(trace.line.map(|l| l.to_string()).unwrap_or_default())
.alignment(Alignment::Right),
Text::from(trace.function().to_string()),
])
}