Closed dizda closed 5 years ago
This allows to be more specific when managing errors and take action accordingly.
use binance::errors::ErrorKind as BinanceLibErrorKind; [...] Err(err) => { println!("Can't put an order!"); match err.0 { BinanceLibErrorKind::BinanceError(code, msg, response) => match code { -1013_i16 => println!("Filter failure: LOT_SIZE!"), -2010_i16 => println!("Funds insufficient! {}", msg), _ => println!("Non-catched code {}: {}", code, msg), }, BinanceLibErrorKind::Msg(msg) => { println!("Binancelib error msg: {}", msg) } _ => println!("Other errors: {}.", err.0), }; }
That might introduce a BC-Break though. Maybe better to bump a minor version.
@dizda Thank you again, I updated the README with the example you provided.
Great. Thank you!
This allows to be more specific when managing errors and take action accordingly.