Browse Source

Merge pull request #25 from ehiggs/dont-panic-when-no-index-found

Prevent panics when bad state is found - e.g. no meta.json or no indexing dir
develop
Paul Masurel GitHub 6 years ago
parent
commit
47d10755c8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      src/main.rs

+ 8
- 1
src/main.rs View File

@@ -22,6 +22,7 @@ extern crate byteorder;
#[macro_use]
extern crate serde_derive;

use std::io::Write;

use clap::{AppSettings, Arg, App, SubCommand};
mod commands;
@@ -137,5 +138,11 @@ fn main() {
"bench" => run_bench_cli,
_ => panic!("Subcommand {} is unknown", subcommand)
};
run_cli(options).unwrap();

if let Err(ref e) = run_cli(options) {
let stderr = &mut std::io::stderr();
let errmsg = "Error writing ot stderr";
writeln!(stderr, "{}", e).expect(errmsg);
std::process::exit(1);
}
}

Loading…
Cancel
Save