|
|
|
@ -47,13 +47,10 @@ pub enum Error { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/// An error invoking another CLI tool.
|
|
|
|
|
#[fail(
|
|
|
|
|
display = "Process exited with {}: {}.\n\nstdout:{}\n\nstderr:\n\n{}", |
|
|
|
|
exit_status, message, stdout, stderr |
|
|
|
|
)] |
|
|
|
|
#[fail(display = "`{}` exited with {}", tool, exit_status)] |
|
|
|
|
Cli { |
|
|
|
|
/// Error message.
|
|
|
|
|
message: String, |
|
|
|
|
tool: String, |
|
|
|
|
/// The underlying CLI's `stdout` output.
|
|
|
|
|
stdout: String, |
|
|
|
|
/// The underlying CLI's `stderr` output.
|
|
|
|
@ -101,9 +98,9 @@ pub enum Error { |
|
|
|
|
|
|
|
|
|
impl Error { |
|
|
|
|
/// Construct a CLI error.
|
|
|
|
|
pub fn cli(message: &str, stdout: Cow<str>, stderr: Cow<str>, exit_status: ExitStatus) -> Self { |
|
|
|
|
pub fn cli(tool: &str, stdout: Cow<str>, stderr: Cow<str>, exit_status: ExitStatus) -> Self { |
|
|
|
|
Error::Cli { |
|
|
|
|
message: message.to_string(), |
|
|
|
|
tool: tool.to_string(), |
|
|
|
|
stdout: stdout.to_string(), |
|
|
|
|
stderr: stderr.to_string(), |
|
|
|
|
exit_status, |
|
|
|
@ -161,7 +158,7 @@ impl Error { |
|
|
|
|
local_minor_version: _, |
|
|
|
|
} => "Your rustc version is not supported. Please install version 1.30.0 or higher.", |
|
|
|
|
Error::Cli { |
|
|
|
|
message: _, |
|
|
|
|
tool: _, |
|
|
|
|
stdout: _, |
|
|
|
|
stderr: _, |
|
|
|
|
exit_status: _, |
|
|
|
|