Better error handling messages.

This commit is contained in:
Stephen Chung
2020-09-28 11:19:49 +08:00
parent a1cf852bb9
commit 5e43f2e5a4
2 changed files with 9 additions and 4 deletions

View File

@@ -643,7 +643,7 @@ impl Dynamic {
};
#[cfg(feature = "no_closure")]
panic!("'no_closure' feature does not support converting into a shared value");
panic!("converting into a shared value is not supported under 'no_closure'");
}
/// Convert the `Dynamic` value into specific type.
@@ -812,7 +812,7 @@ impl Dynamic {
self.try_cast::<T>().unwrap_or_else(|| {
panic!(
"value is {} and cannot be cast to {}",
"cannot cast {} value and to {}",
self_type_name,
type_name::<T>()
)