From e1907114374c842654f86b234b816f57dbbc79d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Tue, 30 Mar 2021 11:21:38 +0200 Subject: add StateError and AudioError --- mumd/src/main.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'mumd/src/main.rs') diff --git a/mumd/src/main.rs b/mumd/src/main.rs index 276e2ce..42be3f8 100644 --- a/mumd/src/main.rs +++ b/mumd/src/main.rs @@ -1,10 +1,13 @@ mod audio; mod client; mod command; +mod error; mod network; mod notify; mod state; +use crate::state::State; + use futures_util::{SinkExt, StreamExt}; use log::*; use mumlib::command::{Command, CommandResponse}; @@ -53,8 +56,16 @@ async fn main() { let (command_sender, command_receiver) = mpsc::unbounded_channel(); + let state = match State::new() { + Ok(s) => s, + Err(e) => { + error!("Error instantiating mumd: {}", e); + return; + } + }; + join!( - client::handle(command_receiver), + client::handle(state, command_receiver), receive_commands(command_sender), ); } -- cgit v1.2.1