summaryrefslogtreecommitdiff
path: root/cli/ops/os.rs
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2020-09-14 18:48:57 +0200
committerBert Belder <bertbelder@gmail.com>2020-09-15 01:50:52 +0200
commitf5b40c918c7d602827622d167728a3e7bae87d9d (patch)
treefb51722e043f4d6bce64a2c7e897cce4ead06c82 /cli/ops/os.rs
parent3da20d19a14ab6838897d281f1b11e49d68bd1a7 (diff)
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476)
Diffstat (limited to 'cli/ops/os.rs')
-rw-r--r--cli/ops/os.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/cli/ops/os.rs b/cli/ops/os.rs
index 9860018a0..1d0263d6c 100644
--- a/cli/ops/os.rs
+++ b/cli/ops/os.rs
@@ -1,6 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-use deno_core::ErrBox;
+use deno_core::error::AnyError;
use deno_core::OpState;
use deno_core::ZeroCopyBuf;
use serde_derive::Deserialize;
@@ -26,7 +26,7 @@ fn op_exec_path(
state: &mut OpState,
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let current_exe = env::current_exe().unwrap();
let cli_state = super::cli_state(state);
cli_state.check_read_blind(&current_exe, "exec_path")?;
@@ -47,7 +47,7 @@ fn op_set_env(
state: &mut OpState,
args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let args: SetEnv = serde_json::from_value(args)?;
let cli_state = super::cli_state(state);
cli_state.check_env()?;
@@ -59,7 +59,7 @@ fn op_env(
state: &mut OpState,
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let cli_state = super::cli_state(state);
cli_state.check_env()?;
let v = env::vars().collect::<HashMap<String, String>>();
@@ -75,7 +75,7 @@ fn op_get_env(
state: &mut OpState,
args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let args: GetEnv = serde_json::from_value(args)?;
let cli_state = super::cli_state(state);
cli_state.check_env()?;
@@ -95,7 +95,7 @@ fn op_delete_env(
state: &mut OpState,
args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let args: DeleteEnv = serde_json::from_value(args)?;
let cli_state = super::cli_state(state);
cli_state.check_env()?;
@@ -112,7 +112,7 @@ fn op_exit(
_state: &mut OpState,
args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let args: Exit = serde_json::from_value(args)?;
std::process::exit(args.code)
}
@@ -121,7 +121,7 @@ fn op_loadavg(
state: &mut OpState,
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let cli_state = super::cli_state(state);
cli_state.check_unstable("Deno.loadavg");
cli_state.check_env()?;
@@ -135,7 +135,7 @@ fn op_hostname(
state: &mut OpState,
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let cli_state = super::cli_state(state);
cli_state.check_unstable("Deno.hostname");
cli_state.check_env()?;
@@ -147,7 +147,7 @@ fn op_os_release(
state: &mut OpState,
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let cli_state = super::cli_state(state);
cli_state.check_unstable("Deno.osRelease");
cli_state.check_env()?;
@@ -159,7 +159,7 @@ fn op_system_memory_info(
state: &mut OpState,
_args: Value,
_zero_copy: &mut [ZeroCopyBuf],
-) -> Result<Value, ErrBox> {
+) -> Result<Value, AnyError> {
let cli_state = super::cli_state(state);
cli_state.check_unstable("Deno.systemMemoryInfo");
cli_state.check_env()?;