summaryrefslogtreecommitdiff
path: root/cli/op_error.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-04-15 20:43:19 -0400
committerGitHub <noreply@github.com>2020-04-15 20:43:19 -0400
commitfab0204cbf20cc1be7874266325bf258fe0ecaca (patch)
treec67b3febde254ea36122966aadf13dfb62b67a0e /cli/op_error.rs
parent7cfd094359f7f94573b084328ad1a956dd70005d (diff)
Make writeSync, readSync, seekSync, openSync, isatty proper synchronous syscalls (#4762)
Diffstat (limited to 'cli/op_error.rs')
-rw-r--r--cli/op_error.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/op_error.rs b/cli/op_error.rs
index 258642f8a..a687eed2b 100644
--- a/cli/op_error.rs
+++ b/cli/op_error.rs
@@ -50,6 +50,7 @@ pub enum ErrorKind {
/// if no better context is available.
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
Other = 22,
+ Busy = 23,
}
#[derive(Debug)]
@@ -103,6 +104,13 @@ impl OpError {
pub fn invalid_utf8() -> OpError {
Self::new(ErrorKind::InvalidData, "invalid utf8".to_string())
}
+
+ pub fn resource_unavailable() -> OpError {
+ Self::new(
+ ErrorKind::Busy,
+ "resource is unavailable because it is in use by a promise".to_string(),
+ )
+ }
}
impl Error for OpError {}