wrap ioerror when it represents oserror E2BIG

This commit is contained in:
Quint Guvernator 2020-06-24 13:40:11 +02:00
parent cca7b19283
commit 2615a1de7c
1 changed files with 12 additions and 1 deletions

View File

@ -33,7 +33,18 @@ impl From<globset::Error> for Error {
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self {
Self::Io(err)
Self::Io(
match err.raw_os_error() {
Some(os_err) => match os_err {
7 => {
let msg = "There are so many changed files that the environment variables of the child process have been overrun. Try running with --no-meta or --no-environment.";
io::Error::new(io::ErrorKind::Other, msg)
},
_ => err,
}
None => err,
}
)
}
}