Skip to content
Snippets Groups Projects
Commit 7815ad08 authored by Michael Aaron Murphy's avatar Michael Aaron Murphy Committed by GitHub
Browse files

Merge pull request #443 from richiejp/spawn_error_handling

Handle unusual errors during process spawning
parents 915e116d 0692033c
No related branches found
No related tags found
No related merge requests found
...@@ -380,10 +380,14 @@ fn execute_command(shell: &mut Shell, command: &mut Command, foreground: bool) - ...@@ -380,10 +380,14 @@ fn execute_command(shell: &mut Shell, command: &mut Command, foreground: bool) -
if foreground { set_foreground(child.id()); } if foreground { set_foreground(child.id()); }
shell.watch_foreground(child.id(), child.id(), || get_full_command(command), |_| ()) shell.watch_foreground(child.id(), child.id(), || get_full_command(command), |_| ())
}, },
Err(_) => { Err(e) => {
let stderr = io::stderr(); let stderr = io::stderr();
let mut stderr = stderr.lock(); let mut stderr = stderr.lock();
let _ = writeln!(stderr, "ion: command not found: {}", get_command_name(command)); let _ = if e.kind() == io::ErrorKind::NotFound {
writeln!(stderr, "ion: Command not found: {}", get_command_name(command))
} else {
writeln!(stderr, "ion: Error spawning process: {}", e)
};
FAILURE FAILURE
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment