diff --git a/ows/crates/ows-cli/src/commands/pay.rs b/ows/crates/ows-cli/src/commands/pay.rs index f33509d2..1cfeb143 100644 --- a/ows/crates/ows-cli/src/commands/pay.rs +++ b/ows/crates/ows-cli/src/commands/pay.rs @@ -105,7 +105,13 @@ pub fn run( let result = rt.block_on(ows_pay::pay(&wallet, url, method, body))?; - if let Some(ref payment) = result.payment { + if result.status >= 400 { + if result.payment.is_some() { + eprintln!("HTTP {} — payment rejected by server", result.status); + } else { + eprintln!("HTTP {}", result.status); + } + } else if let Some(ref payment) = result.payment { if !payment.amount.is_empty() { eprintln!( "Paid {} on {} via {}", @@ -116,10 +122,6 @@ pub fn run( } } - if result.status >= 400 { - eprintln!("HTTP {}", result.status); - } - println!("{}", result.body); Ok(()) }