mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
Rename BadFileDescriptor
This commit is contained in:
parent
930df1848a
commit
7cc9b64ff7
3 changed files with 3 additions and 9 deletions
|
@ -150,10 +150,7 @@ impl From<hyper::Error> for DenoError {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn bad_resource() -> DenoError {
|
pub fn bad_resource() -> DenoError {
|
||||||
new(
|
new(ErrorKind::BadResource, String::from("bad resource id"))
|
||||||
ErrorKind::BadFileDescriptor, // TODO Rename to BadResource
|
|
||||||
String::from("bad resource id"),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn permission_denied() -> DenoError {
|
pub fn permission_denied() -> DenoError {
|
||||||
|
|
|
@ -67,7 +67,7 @@ enum ErrorKind: byte {
|
||||||
Other,
|
Other,
|
||||||
UnexpectedEof,
|
UnexpectedEof,
|
||||||
|
|
||||||
BadFileDescriptor,
|
BadResource,
|
||||||
|
|
||||||
// url errors
|
// url errors
|
||||||
|
|
||||||
|
|
|
@ -609,10 +609,7 @@ fn op_shutdown(
|
||||||
let rid = inner.rid();
|
let rid = inner.rid();
|
||||||
let how = inner.how();
|
let how = inner.how();
|
||||||
match resources::lookup(rid) {
|
match resources::lookup(rid) {
|
||||||
None => odd_future(errors::new(
|
None => odd_future(errors::bad_resource()),
|
||||||
errors::ErrorKind::BadFileDescriptor,
|
|
||||||
String::from("Bad File Descriptor"),
|
|
||||||
)),
|
|
||||||
Some(mut resource) => {
|
Some(mut resource) => {
|
||||||
let shutdown_mode = match how {
|
let shutdown_mode = match how {
|
||||||
0 => Shutdown::Read,
|
0 => Shutdown::Read,
|
||||||
|
|
Loading…
Reference in a new issue