summaryrefslogtreecommitdiff
path: root/cli/ops/tty.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/tty.rs
parent444b1ab68efdf0ceb36dc4a495ac83c809e15b2b (diff)
Allow BadResource errors to take a custom message (#4251)
Diffstat (limited to 'cli/ops/tty.rs')
-rw-r--r--cli/ops/tty.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/ops/tty.rs b/cli/ops/tty.rs
index b803d99fb..69ac66688 100644
--- a/cli/ops/tty.rs
+++ b/cli/ops/tty.rs
@@ -68,7 +68,7 @@ pub fn op_set_raw(
let state = state_.borrow_mut();
let resource = state.resource_table.get::<StreamResource>(rid);
if resource.is_none() {
- return Err(OpError::bad_resource());
+ return Err(OpError::bad_resource_id());
}
// For now, only stdin.
@@ -113,7 +113,7 @@ pub fn op_set_raw(
let mut state = state_.borrow_mut();
let resource = state.resource_table.get_mut::<StreamResource>(rid);
if resource.is_none() {
- return Err(OpError::bad_resource());
+ return Err(OpError::bad_resource_id());
}
if is_raw {
@@ -197,7 +197,7 @@ pub fn op_isatty(
let state = state_.borrow_mut();
if !state.resource_table.has(rid) {
- return Err(OpError::bad_resource());
+ return Err(OpError::bad_resource_id());
}
let resource = state.resource_table.get::<StreamResource>(rid);