|
@@ -156,7 +156,7 @@ impl Relayer {
|
|
|
let msg: Result<Response, _> = serde_json::from_str(&msg);
|
|
|
|
|
|
if let Ok(msg) = msg {
|
|
|
- if let Err(error) = broadcast_to_listeners.try_send((Event::Response(msg), url.to_owned())) {
|
|
|
+ if let Err(error) = broadcast_to_listeners.try_send((Event::Response(msg.into()), url.to_owned())) {
|
|
|
log::error!("{}: Reconnecting client because of {}", url, error);
|
|
|
break;
|
|
|
}
|
|
@@ -197,7 +197,10 @@ impl Relayer {
|
|
|
|
|
|
/// Sends a requests to this relayer
|
|
|
pub async fn send(&self, request: Request) -> Result<(), Error> {
|
|
|
- Ok(self.send_to_socket.send(request).await?)
|
|
|
+ self.send_to_socket
|
|
|
+ .send(request)
|
|
|
+ .await
|
|
|
+ .map_err(|e| Error::Sync(Box::new(e)))
|
|
|
}
|
|
|
|
|
|
/// Stops the background thread that has the connection to this relayer
|