diff options
author | 2025-05-12 18:29:03 +0100 | |
---|---|---|
committer | 2025-05-12 18:29:03 +0100 | |
commit | f1540591930aff9d9f584e6ce028c2e49cba1be2 (patch) | |
tree | dacbb84b9bc2759ee65a3c3db91ae6d3d6704a42 /filamento/src | |
parent | 8c4cee9a622b026aa231dbdf590480786d142ea2 (diff) | |
download | luz-f1540591930aff9d9f584e6ce028c2e49cba1be2.tar.gz luz-f1540591930aff9d9f584e6ce028c2e49cba1be2.tar.bz2 luz-f1540591930aff9d9f584e6ce028c2e49cba1be2.zip |
fix(filamento): stanza error panic
Diffstat (limited to '')
-rw-r--r-- | filamento/src/error.rs | 4 | ||||
-rw-r--r-- | filamento/src/logic/process_stanza.rs | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/filamento/src/error.rs b/filamento/src/error.rs index 9334793..af3320f 100644 --- a/filamento/src/error.rs +++ b/filamento/src/error.rs @@ -330,8 +330,8 @@ pub enum PresenceError { Unsupported, #[error("missing from")] MissingFrom, - #[error("stanza error: {0}")] - StanzaError(#[from] stanza::client::error::Error), + #[error("stanza error: {0:?}")] + StanzaError(Option<stanza::client::error::Error>), } #[derive(Debug, Error, Clone)] diff --git a/filamento/src/logic/process_stanza.rs b/filamento/src/logic/process_stanza.rs index 3bc4b8c..30d0830 100644 --- a/filamento/src/logic/process_stanza.rs +++ b/filamento/src/logic/process_stanza.rs @@ -479,13 +479,7 @@ pub async fn recv_presence( stanza::client::presence::PresenceType::Error => { // TODO: is there any other information that should go with the error? also MUST have an error, otherwise it's a different error. maybe it shoulnd't be an option. // TODO: ughhhhhhhhhhhhh these stanza errors should probably just have an option, and custom display - Err(PresenceError::StanzaError( - presence - .errors - .first() - .cloned() - .expect("error MUST have error"), - )) + Err(PresenceError::StanzaError(presence.errors.first().cloned())) } // should not happen (error to server) stanza::client::presence::PresenceType::Probe => { |