1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

Rename BadFileDescriptor

This commit is contained in:
J2P 2018-10-11 00:15:47 +09:00 committed by Ryan Dahl
parent 930df1848a
commit 7cc9b64ff7
3 changed files with 3 additions and 9 deletions

View file

@ -150,10 +150,7 @@ impl From<hyper::Error> 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 {

View file

@ -67,7 +67,7 @@ enum ErrorKind: byte {
Other,
UnexpectedEof,
BadFileDescriptor,
BadResource,
// url errors

View file

@ -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,