Improve error messaging

This commit is contained in:
Rene Vergara 2024-05-02 12:10:53 -05:00
parent c144a6d624
commit 652e95c361
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -1824,11 +1824,13 @@ pub extern "C" fn rust_wrapper_create_transaction(
},
Err(e) => {
match e {
Error::InsufficientFunds(_y) => {
Error::InsufficientFunds(y) => {
println!("{:?}", y);
let x = Hhex {bytes: vec![0]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::ChangeRequired(_y1) => {
Error::ChangeRequired(y1) => {
println!("{:?}", y1);
let x = Hhex {bytes: vec![1]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
@ -1836,27 +1838,27 @@ pub extern "C" fn rust_wrapper_create_transaction(
let x = Hhex {bytes: vec![2]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::Balance(x) => {
Error::Balance(y3) => {
let x = Hhex {bytes: vec![3]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::TransparentBuild(x) => {
Error::TransparentBuild(y4) => {
let x = Hhex {bytes: vec![4]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::SaplingBuild(x) => {
Error::SaplingBuild(y5) => {
let x = Hhex {bytes: vec![5]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::OrchardBuild(x) => {
Error::OrchardBuild(y7) => {
let x = Hhex {bytes: vec![6]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::OrchardSpend(x) => {
Error::OrchardSpend(y8) => {
let x = Hhex {bytes: vec![7]};
marshall_to_haskell_var(&x, out, out_len, RW);
},
Error::OrchardRecipient(x) => {
Error::OrchardRecipient(y9) => {
let x = Hhex {bytes: vec![8]};
marshall_to_haskell_var(&x, out, out_len, RW);
},