diff options
Diffstat (limited to 'cli/errors.rs')
-rw-r--r-- | cli/errors.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/errors.rs b/cli/errors.rs index 25b3fc332..b1808f733 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -88,6 +88,10 @@ fn get_resolution_error_class(err: &ResolutionError) -> &'static str { } } +fn get_try_from_int_error_class(_: &std::num::TryFromIntError) -> &'static str { + "TypeError" +} + pub fn get_error_class_name(e: &AnyError) -> &'static str { deno_runtime::errors::get_error_class_name(e) .or_else(|| { @@ -106,5 +110,9 @@ pub fn get_error_class_name(e: &AnyError) -> &'static str { e.downcast_ref::<ResolutionError>() .map(get_resolution_error_class) }) + .or_else(|| { + e.downcast_ref::<std::num::TryFromIntError>() + .map(get_try_from_int_error_class) + }) .unwrap_or("Error") } |