From 4cfca0a884af6a467ff38e1d024184f08070e061 Mon Sep 17 00:00:00 2001 From: peefy Date: Wed, 22 Nov 2023 12:45:47 +0800 Subject: [PATCH] chore: bump error message to stderr Signed-off-by: peefy --- kclvm/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kclvm/src/lib.rs b/kclvm/src/lib.rs index fe1753861..8a17b7d21 100644 --- a/kclvm/src/lib.rs +++ b/kclvm/src/lib.rs @@ -85,9 +85,9 @@ 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)) } @@ -95,7 +95,7 @@ pub unsafe extern "C" fn kclvm_cli_main(argc: c_int, argv: *const *const c_char) 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)) }