Improve error message on exception.

This commit is contained in:
losfair 2020-01-14 20:56:34 +08:00
parent a45cbd6bbc
commit 6dfd5916c2

View File

@ -210,7 +210,7 @@ impl std::fmt::Display for RuntimeError {
} else if let Some(s) = data.downcast_ref::<&str>() {
write!(f, "\"{}\"", s)
} else if let Some(exc_code) = data.downcast_ref::<ExceptionCode>() {
write!(f, "\"{:?}\"", exc_code)
write!(f, "Caught exception of type \"{:?}\".", exc_code)
} else {
write!(f, "unknown error")
}