#![allow(
clippy::print_stdout,
clippy::print_stderr,
clippy::uninlined_format_args
)]
use nsip::{Error, NsipClient};
#[tokio::main]
async fn main() {
let client = NsipClient::new();
match client.animal_details("INVALID_ID").await {
Ok(details) => {
println!("Found: {}", details.lpn_id);
},
Err(Error::NotFound(msg)) => {
eprintln!("Animal not found: {}", msg);
},
Err(Error::Timeout { message, .. }) => {
eprintln!("Request timed out: {}", message);
},
Err(Error::Api {
status, message, ..
}) => {
eprintln!("API error (HTTP {}): {}", status, message);
},
Err(Error::Connection { message, .. }) => {
eprintln!("Connection failed: {}", message);
},
Err(e) => {
eprintln!("Unexpected error: {}", e);
},
}
}