diff --git a/src/errors.rs b/src/errors.rs index ab6504e64c..0f5320348f 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -150,10 +150,7 @@ impl From for DenoError { } pub fn bad_resource() -> DenoError { - new( - ErrorKind::BadFileDescriptor, // TODO Rename to BadResource - String::from("bad resource id"), - ) + new(ErrorKind::BadResource, String::from("bad resource id")) } pub fn permission_denied() -> DenoError { diff --git a/src/msg.fbs b/src/msg.fbs index 16d10cdff0..869452ced6 100644 --- a/src/msg.fbs +++ b/src/msg.fbs @@ -67,7 +67,7 @@ enum ErrorKind: byte { Other, UnexpectedEof, - BadFileDescriptor, + BadResource, // url errors diff --git a/src/ops.rs b/src/ops.rs index f590a3bb56..3aad572bdb 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -609,10 +609,7 @@ fn op_shutdown( let rid = inner.rid(); let how = inner.how(); match resources::lookup(rid) { - None => odd_future(errors::new( - errors::ErrorKind::BadFileDescriptor, - String::from("Bad File Descriptor"), - )), + None => odd_future(errors::bad_resource()), Some(mut resource) => { let shutdown_mode = match how { 0 => Shutdown::Read,