Fix euph errors always turning into conn::Errors

This commit is contained in:
Joscha 2023-04-08 20:22:16 +02:00
parent 0c135844a4
commit 0f217a6279
2 changed files with 5 additions and 3 deletions

View file

@ -31,6 +31,7 @@ Procedure when bumping the version number:
- **(breaking)** Deserializing empty events and replies by turning unit structs into empty structs - **(breaking)** Deserializing empty events and replies by turning unit structs into empty structs
- `phone` and `mobile` emoji - `phone` and `mobile` emoji
- Instances getting stuck in "Connecting" state - Instances getting stuck in "Connecting" state
- Euph errors always turning into `conn::Error`s
## v0.3.1 - 2023-02-26 ## v0.3.1 - 2023-02-26

View file

@ -444,10 +444,11 @@ impl Conn {
self.replies.complete(id, packet.clone()); self.replies.complete(id, packet.clone());
} }
match &packet.content { if let Ok(data) = &packet.content {
Ok(data) => self.on_data(&packet.id, data).await, self.on_data(&packet.id, data).await?;
Err(msg) => Err(Error::Euph(msg.clone())),
} }
Ok(())
} }
async fn on_data(&mut self, id: &Option<String>, data: &Data) -> Result<()> { async fn on_data(&mut self, id: &Option<String>, data: &Data) -> Result<()> {