diff options
Diffstat (limited to 'cli/tools/repl')
-rw-r--r-- | cli/tools/repl/session.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index 40cf7d3b0..4a30c93c4 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -258,9 +258,15 @@ impl ReplSession { Ok(if let Some(exception_details) = exception_details { session.set_last_thrown_error(&result).await?; let description = match exception_details.exception { - Some(exception) => exception - .description - .unwrap_or_else(|| "undefined".to_string()), + Some(exception) => { + if let Some(description) = exception.description { + description + } else if let Some(value) = exception.value { + value.to_string() + } else { + "undefined".to_string() + } + } None => "Unknown exception".to_string(), }; EvaluationOutput::Error(format!( |