From fd1402074c762c11073ed07b7f16808335f035a5 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 9 Sep 2020 17:54:05 +0200 Subject: [PATCH] try this. If it goes red, I'll roll back. --- cli/errors.rs | 3 ++- cli/tests/unit/process_test.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/errors.rs b/cli/errors.rs index 7fc1462f28c3f8..4838cfed67d095 100644 --- a/cli/errors.rs +++ b/cli/errors.rs @@ -156,10 +156,11 @@ fn get_url_parse_error_class(_error: &url::ParseError) -> &'static str { fn get_nix_error_class(error: &nix::Error) -> &'static str { use nix::errno::Errno::*; match error { - nix::Error::Sys(EPERM) => "PermissionDenied", + nix::Error::Sys(ECHILD) => "NotFound", nix::Error::Sys(EINVAL) => "TypeError", nix::Error::Sys(ENOENT) => "NotFound", nix::Error::Sys(ENOTTY) => "BadResource", + nix::Error::Sys(EPERM) => "PermissionDenied", nix::Error::Sys(UnknownErrno) => "Error", nix::Error::Sys(_) => "Error", nix::Error::InvalidPath => "TypeError", diff --git a/cli/tests/unit/process_test.ts b/cli/tests/unit/process_test.ts index 11033555545b20..15a98d7aad433a 100644 --- a/cli/tests/unit/process_test.ts +++ b/cli/tests/unit/process_test.ts @@ -385,6 +385,7 @@ unitTest( assertThrows( () => p.kill(Deno.Signal.SIGQUIT), + Deno.errors.NotFound, ); p.close();