diff options
| author | mat <github@matdoes.dev> | 2022-10-29 14:02:57 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-10-29 14:02:57 -0500 |
| commit | 65d8fdcb6c13e8802a79fa2df570a57978b3c430 (patch) | |
| tree | ab84e188a1989696fd44cc5c39e3d3abc93ce4a3 | |
| parent | f235c9d064fbb2cc7d51a0c921ee632103dd9567 (diff) | |
| download | azalea-drasl-65d8fdcb6c13e8802a79fa2df570a57978b3c430.tar.xz | |
oop fix another unwrap
| -rwxr-xr-x | azalea-client/src/lib.rs | 2 | ||||
| -rw-r--r-- | azalea/src/lib.rs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index 84af0298..265fbf8b 100755 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -14,7 +14,7 @@ pub mod ping; mod player; pub use account::Account; -pub use client::{Client, ClientInformation, Event}; +pub use client::{Client, ClientInformation, Event, JoinError}; pub use movement::MoveDirection; pub use player::Player; diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index a7d0791a..2d0344fc 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -123,6 +123,8 @@ where pub enum Error { #[error("Invalid address")] InvalidAddress, + #[error("Join error: {0}")] + Join(#[from] azalea_client::JoinError), } /// Join a server and start handling events. This function will run forever until @@ -151,7 +153,7 @@ pub async fn start< Err(_) => return Err(Error::InvalidAddress), }; - let (bot, mut rx) = Client::join(&options.account, address).await.unwrap(); + let (bot, mut rx) = Client::join(&options.account, address).await?; let state = options.state; let bot_plugin = bot::Plugin::default(); |
