diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-01-20 16:50:16 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-20 10:50:16 -0500 |
commit | c90036ab88bb1ae6b9c87d5e368f56d8c8afab69 (patch) | |
tree | ebc7b762151489440135c029a1217c80bb810900 /cli/ops/permissions.rs | |
parent | e83658138bff3605bd37c2b4ae4703081d884729 (diff) |
refactor: reduce number of ErrorKind variants (#3662)
Diffstat (limited to 'cli/ops/permissions.rs')
-rw-r--r-- | cli/ops/permissions.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/ops/permissions.rs b/cli/ops/permissions.rs index 172ce97b1..4d1fb3337 100644 --- a/cli/ops/permissions.rs +++ b/cli/ops/permissions.rs @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{Deserialize, JsonOp, Value}; -use crate::deno_error::type_error; +use crate::deno_error::other_error; use crate::fs as deno_fs; use crate::ops::json_op; use crate::state::ThreadSafeState; @@ -99,7 +99,7 @@ pub fn op_request_permission( "env" => Ok(permissions.request_env()), "plugin" => Ok(permissions.request_plugin()), "hrtime" => Ok(permissions.request_hrtime()), - n => Err(type_error(format!("No such permission name: {}", n))), + n => Err(other_error(format!("No such permission name: {}", n))), }?; Ok(JsonOp::Sync(json!({ "state": perm.to_string() }))) } |