summaryrefslogtreecommitdiff
path: root/core/ops.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2021-11-16 09:02:28 -0500
committerGitHub <noreply@github.com>2021-11-16 09:02:28 -0500
commitb2036a4db71afd67a78f932528143fb07faea538 (patch)
treea78612e8868609af7aa6fe9ecf49d3ab0c42c9da /core/ops.rs
parentf9f9ddc5e308809343bbf5c07d4487df5a1b93cf (diff)
refactor: re-export anyhow from deno_core (#12777)
Diffstat (limited to 'core/ops.rs')
-rw-r--r--core/ops.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/ops.rs b/core/ops.rs
index f62fe7a8e..13f001146 100644
--- a/core/ops.rs
+++ b/core/ops.rs
@@ -1,11 +1,11 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::error::type_error;
-use crate::error::AnyError;
use crate::gotham_state::GothamState;
use crate::ops_metrics::OpsTracker;
use crate::resources::ResourceTable;
use crate::runtime::GetErrorClassFn;
+use anyhow::Error;
use futures::future::maybe_done;
use futures::future::FusedFuture;
use futures::future::MaybeDone;
@@ -96,13 +96,13 @@ pub struct OpPayload<'a, 'b, 'c> {
impl<'a, 'b, 'c> OpPayload<'a, 'b, 'c> {
pub fn deserialize<T: DeserializeOwned, U: DeserializeOwned>(
self,
- ) -> Result<(T, U), AnyError> {
+ ) -> Result<(T, U), Error> {
let a: T = serde_v8::from_v8(self.scope, self.a)
- .map_err(AnyError::from)
+ .map_err(Error::from)
.map_err(|e| type_error(format!("Error parsing args: {}", e)))?;
let b: U = serde_v8::from_v8(self.scope, self.b)
- .map_err(AnyError::from)
+ .map_err(Error::from)
.map_err(|e| type_error(format!("Error parsing args: {}", e)))?;
Ok((a, b))
}
@@ -144,7 +144,7 @@ pub struct OpError {
}
pub fn serialize_op_result<R: Serialize + 'static>(
- result: Result<R, AnyError>,
+ result: Result<R, Error>,
state: Rc<RefCell<OpState>>,
) -> OpResult {
match result {