Map EEXIST to PathAlreadyExists error, closes #20226
This commit is contained in:
parent
f673e9841f
commit
eb4b20288e
3 changed files with 17 additions and 0 deletions
|
|
@ -109,6 +109,8 @@ pub fn decode_error(errno: i32) -> IoError {
|
|||
"file descriptor is not a TTY"),
|
||||
libc::ETIMEDOUT => (io::TimedOut, "operation timed out"),
|
||||
libc::ECANCELED => (io::TimedOut, "operation aborted"),
|
||||
libc::consts::os::posix88::EEXIST =>
|
||||
(io::PathAlreadyExists, "path already exists"),
|
||||
|
||||
// These two constants can have the same value on some systems,
|
||||
// but different values on others, so we can't use a match
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ pub fn decode_error(errno: i32) -> IoError {
|
|||
"invalid handle provided to function"),
|
||||
libc::ERROR_NOTHING_TO_TERMINATE =>
|
||||
(io::InvalidInput, "no process to kill"),
|
||||
libc::ERROR_ALREADY_EXISTS =>
|
||||
(io::PathAlreadyExists, "path already exists"),
|
||||
|
||||
// libuv maps this error code to EISDIR. we do too. if it is found
|
||||
// to be incorrect, we can add in some more machinery to only
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue