Skip to content

Commit

Permalink
feat: print friendly error instead of debug info in main
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Oct 8, 2024
1 parent 8c67f41 commit 3d58cc2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ use std::fs::File;
use std::io::{self, Read, Write};
use torrust_bencode2json::parsers::{self, BencodeParser};

fn main() -> Result<(), parsers::error::Error> {
fn main() {
if let Err(e) = run() {
eprintln!("Error: {e}");
std::process::exit(1);
}
}

fn run() -> Result<(), parsers::error::Error> {
let matches = Command::new("torrust-bencode2json")
.version("0.1.0")
.author("Torrust Organization")
Expand Down

0 comments on commit 3d58cc2

Please sign in to comment.