Skip to content

Commit

Permalink
Slightly improve error messages
Browse files Browse the repository at this point in the history
* print "build failed" error to stderr
* don't print "warning: warning:"
  • Loading branch information
matklad committed May 20, 2016
1 parent 235e2c2 commit 78e7a51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/cargo/ops/cargo_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ pub fn doc(manifest_path: &Path,
match open_docs(&path) {
Ok(m) => try!(shell.status("Launching", m)),
Err(e) => {
try!(shell.warn(
"warning: could not determine a browser to open docs with, tried:"));
for method in e {
try!(shell.warn(format!("\t{}", method)));
}
let message = format!(
"could not determine a browser to open docs with, tried:{}",
e.into_iter().map(|method| format!("\n\t{}", method)).collect::<String>()
);
try!(shell.warn(message));
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/cargo/ops/cargo_rustc/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::fmt;
use std::sync::mpsc::{channel, Sender, Receiver};

use crossbeam::{self, Scope};
use term::color::YELLOW;

use core::{PackageId, Target, Profile};
use util::{Config, DependencyQueue, Fresh, Dirty, Freshness};
Expand Down Expand Up @@ -147,9 +146,8 @@ impl<'a> JobQueue<'a> {
}
Err(e) => {
if self.active > 0 {
try!(config.shell().say(
"Build failed, waiting for other \
jobs to finish...", YELLOW));
try!(config.shell().error(
"build failed, waiting for other jobs to finish..."));
for _ in self.rx.iter().take(self.active as usize) {}
}
return Err(e)
Expand Down

0 comments on commit 78e7a51

Please sign in to comment.