diff options
| author | Bert Belder <bertbelder@gmail.com> | 2020-08-26 00:22:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-26 00:22:15 +0200 |
| commit | 9bfb0df805719cb3f022a5b5d9f9d898ae954c2e (patch) | |
| tree | 6c7d62d95fcbde54ebbe1035bdc74618c63cfbc0 /cli/ops/resources.rs | |
| parent | d0ccab7fb7dd80030d3765ca9a9af44de6ecda5a (diff) | |
refactor: remove OpError, use ErrBox everywhere (#7187)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/ops/resources.rs')
| -rw-r--r-- | cli/ops/resources.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/ops/resources.rs b/cli/ops/resources.rs index a24b3b382..fb3c1bc79 100644 --- a/cli/ops/resources.rs +++ b/cli/ops/resources.rs @@ -1,9 +1,9 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use super::dispatch_json::{Deserialize, JsonOp, Value}; -use crate::op_error::OpError; use crate::state::State; use deno_core::CoreIsolate; use deno_core::CoreIsolateState; +use deno_core::ErrBox; use deno_core::ZeroCopyBuf; use std::rc::Rc; @@ -17,7 +17,7 @@ fn op_resources( _state: &Rc<State>, _args: Value, _zero_copy: &mut [ZeroCopyBuf], -) -> Result<JsonOp, OpError> { +) -> Result<JsonOp, ErrBox> { let serialized_resources = isolate_state.resource_table.borrow().entries(); Ok(JsonOp::Sync(json!(serialized_resources))) } @@ -28,7 +28,7 @@ fn op_close( _state: &Rc<State>, args: Value, _zero_copy: &mut [ZeroCopyBuf], -) -> Result<JsonOp, OpError> { +) -> Result<JsonOp, ErrBox> { #[derive(Deserialize)] struct CloseArgs { rid: i32, @@ -37,6 +37,6 @@ fn op_close( let mut resource_table = isolate_state.resource_table.borrow_mut(); resource_table .close(args.rid as u32) - .ok_or_else(OpError::bad_resource_id)?; + .ok_or_else(ErrBox::bad_resource_id)?; Ok(JsonOp::Sync(json!({}))) } |
