summaryrefslogtreecommitdiff
path: root/cli/ops/process.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-03-05 08:30:41 -0500
committerGitHub <noreply@github.com>2020-03-05 08:30:41 -0500
commit54a1688868810af0ef16f5c186dfb839f2fce23f (patch)
tree4aa8a2a1f1b9856c3d242e4a891645fda361767a /cli/ops/process.rs
parent444b1ab68efdf0ceb36dc4a495ac83c809e15b2b (diff)
Allow BadResource errors to take a custom message (#4251)
Diffstat (limited to 'cli/ops/process.rs')
-rw-r--r--cli/ops/process.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/ops/process.rs b/cli/ops/process.rs
index ad6a022bf..743ffa22b 100644
--- a/cli/ops/process.rs
+++ b/cli/ops/process.rs
@@ -27,10 +27,10 @@ fn clone_file(rid: u32, state: &State) -> Result<std::fs::File, OpError> {
let repr = state
.resource_table
.get_mut::<StreamResource>(rid)
- .ok_or_else(OpError::bad_resource)?;
+ .ok_or_else(OpError::bad_resource_id)?;
let file = match repr {
StreamResource::FsFile(ref mut file, _) => file,
- _ => return Err(OpError::bad_resource()),
+ _ => return Err(OpError::bad_resource_id()),
};
let tokio_file = futures::executor::block_on(file.try_clone())?;
let std_file = futures::executor::block_on(tokio_file.into_std());
@@ -190,7 +190,7 @@ fn op_run_status(
let resource_table = &mut state.borrow_mut().resource_table;
let child_resource = resource_table
.get_mut::<ChildResource>(rid)
- .ok_or_else(OpError::bad_resource)?;
+ .ok_or_else(OpError::bad_resource_id)?;
let child = &mut child_resource.child;
child.map_err(OpError::from).poll_unpin(cx)
})