@@ -96,7 +96,7 @@ pub fn process_executed<T>(result: CliResult<Option<T>>, shell: &mut MultiShell)
96
96
where T : Encodable
97
97
{
98
98
match result {
99
- Err ( e) => handle_error ( e, shell) ,
99
+ Err ( e) => handle_cli_error ( e, shell) ,
100
100
Ok ( Some ( encodable) ) => {
101
101
let encoded = json:: encode ( & encodable) . unwrap ( ) ;
102
102
println ! ( "{}" , encoded) ;
@@ -150,8 +150,8 @@ pub fn shell(verbosity: Verbosity, color_config: ColorConfig) -> MultiShell {
150
150
}
151
151
}
152
152
153
- pub fn handle_error ( err : CliError , shell : & mut MultiShell ) {
154
- debug ! ( "handle_error ; err={:?}" , err) ;
153
+ pub fn handle_cli_error ( err : CliError , shell : & mut MultiShell ) {
154
+ debug ! ( "handle_cli_error ; err={:?}" , err) ;
155
155
156
156
let CliError { error, exit_code, unknown } = err;
157
157
// exit_code == 0 is non-fatal error, e.g. docopt version info
@@ -177,6 +177,13 @@ pub fn handle_error(err: CliError, shell: &mut MultiShell) {
177
177
std:: process:: exit ( exit_code) ;
178
178
}
179
179
180
+ pub fn handle_error ( err : & CargoError , shell : & mut MultiShell ) {
181
+ debug ! ( "handle_error; err={:?}" , err) ;
182
+
183
+ let _ignored_result = shell. error ( err) ;
184
+ handle_cause ( err, shell) ;
185
+ }
186
+
180
187
fn handle_cause ( mut cargo_err : & CargoError , shell : & mut MultiShell ) -> bool {
181
188
let verbose = shell. get_verbose ( ) ;
182
189
let mut err;
0 commit comments