From 0dafb6487f3981b0293cfa3163bb46bfc377a39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Bro=C5=84ski?= Date: Tue, 6 Feb 2024 21:53:59 +0100 Subject: [PATCH] Use stderr for errors. --- kairos-cli/bin/main.rs | 2 +- kairos-cli/tests/cli_tests.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kairos-cli/bin/main.rs b/kairos-cli/bin/main.rs index a0f2789c..25c5adce 100644 --- a/kairos-cli/bin/main.rs +++ b/kairos-cli/bin/main.rs @@ -39,7 +39,7 @@ fn main() { println!("{}", output) } Err(error) => { - println!("{}", error); + eprintln!("{}", error); process::exit(1); } } diff --git a/kairos-cli/tests/cli_tests.rs b/kairos-cli/tests/cli_tests.rs index 2aaf6243..c047db5b 100644 --- a/kairos-cli/tests/cli_tests.rs +++ b/kairos-cli/tests/cli_tests.rs @@ -64,7 +64,7 @@ fn deposit_invalid_amount() { .arg(secret_key_path); cmd.assert() .failure() - .stdout("failed to parse 'amount' as u64\n"); + .stderr("failed to parse 'amount' as u64\n"); } #[test] @@ -79,7 +79,7 @@ fn deposit_invalid_private_key_path() { .arg(secret_key_path); cmd.assert() .failure() - .stdout("cryptography error: failed to parse private key\n"); + .stderr("cryptography error: failed to parse private key\n"); } #[test] @@ -96,5 +96,5 @@ fn transfer_invalid_recipient() { .arg(secret_key_path); cmd.assert() .failure() - .stdout("cryptography error: failed to serialize signature/key\n"); + .stderr("cryptography error: failed to serialize signature/key\n"); }