Skip to content

Commit

Permalink
chore: bump error message to stderr
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Nov 22, 2023
1 parent 1d34307 commit 4cfca0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kclvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,17 @@ pub unsafe extern "C" fn kclvm_cli_main(argc: c_int, argv: *const *const c_char)
Err(err) => {
let backtrace = format!("{}", err.backtrace());
if backtrace.is_empty() || backtrace.contains("disabled backtrace") {
println!("Error: {err}");
eprintln!("{err}");
} else {
println!("Error: {err}\nStack backtrace:\n{backtrace}");
eprintln!("{err}\nStack backtrace:\n{backtrace}");
}
Box::into_raw(Box::new(ExitCode::FAILURE))
}
},
Err(err) => {
let err_str = kclvm_error::err_to_str(err);
if !err_str.is_empty() {
println!("Error: {err_str}");
eprintln!("{err_str}");
}
Box::into_raw(Box::new(ExitCode::FAILURE))
}
Expand Down

0 comments on commit 4cfca0a

Please sign in to comment.