diff options
Diffstat (limited to 'cli/op_error.rs')
-rw-r--r-- | cli/op_error.rs | 8 |
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 {} |