♻️ Add Room domain entity
This commit is contained in:
@@ -37,8 +37,11 @@ impl Requester {
|
||||
pub async fn init(&self) -> anyhow::Result<()> {
|
||||
let (reply, mut response) = oneshot();
|
||||
|
||||
// TODO: Handle error case.
|
||||
self.tx.send(WorkerTask::Init(reply)).unwrap();
|
||||
if let Err(err) = self.tx.send(WorkerTask::Init(reply)) {
|
||||
let msg = format!("Unable to request the init of the Matrix client: {err}");
|
||||
return Err(anyhow::Error::msg(msg));
|
||||
}
|
||||
|
||||
match response.recv().await {
|
||||
Some(result) => Ok(result),
|
||||
None => Err(anyhow::Error::msg("TBD")),
|
||||
@@ -48,8 +51,11 @@ impl Requester {
|
||||
pub async fn login(&self, style: LoginStyle) -> anyhow::Result<()> {
|
||||
let (reply, mut response) = oneshot();
|
||||
|
||||
// TODO: Handle error case.
|
||||
self.tx.send(WorkerTask::Login(style, reply)).unwrap();
|
||||
if let Err(err) = self.tx.send(WorkerTask::Login(style, reply)) {
|
||||
let msg = format!("Unable to request login to the Matrix client: {err}");
|
||||
return Err(anyhow::Error::msg(msg));
|
||||
}
|
||||
|
||||
match response.recv().await {
|
||||
Some(result) => result,
|
||||
None => Err(anyhow::Error::msg("TBD")),
|
||||
|
Reference in New Issue
Block a user