Skip to content

Commit

Permalink
Merge pull request #416 from googlefonts/catch-and-print
Browse files Browse the repository at this point in the history
Manually catch & print errors in main()
  • Loading branch information
cmyr authored Aug 23, 2023
2 parents bdce702 + 65948b0 commit c267b29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fontc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ use fontbe::orchestration::Context as BeContext;
use fontc::{init_paths, write_font_file, Args, ChangeDetector, Config, Error};
use fontir::orchestration::Context as FeContext;

fn main() -> Result<(), Error> {
fn main() {
// catch and print errors manually, to avoid just seeing the Debug impls
if let Err(e) = run() {
// we have a CI check that forbids eprintln, but we're very clever, so
let _ = writeln!(std::io::stderr(), "{e}");
std::process::exit(1);
}
}

fn run() -> Result<(), Error> {
env_logger::builder()
.format(|buf, record| {
let ts = buf.timestamp_micros();
Expand Down

0 comments on commit c267b29

Please sign in to comment.