forked from kemitix/git-next
feat: return better errors to user on server failure
This commit is contained in:
parent
9a9c73d929
commit
1650e93920
2 changed files with 4 additions and 5 deletions
|
@ -51,7 +51,7 @@ fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
Server::Start => {
|
Server::Start => {
|
||||||
let sleep_duration = std::time::Duration::from_secs(10);
|
let sleep_duration = std::time::Duration::from_secs(10);
|
||||||
server::start(fs, net, repository_factory, sleep_duration);
|
server::start(fs, net, repository_factory, sleep_duration)?;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub fn start(
|
||||||
net: Network,
|
net: Network,
|
||||||
repo: Box<dyn RepositoryFactory>,
|
repo: Box<dyn RepositoryFactory>,
|
||||||
sleep_duration: std::time::Duration,
|
sleep_duration: std::time::Duration,
|
||||||
) {
|
) -> Result<()> {
|
||||||
init_logging();
|
init_logging();
|
||||||
|
|
||||||
let execution = async move {
|
let execution = async move {
|
||||||
|
@ -57,9 +57,8 @@ pub fn start(
|
||||||
};
|
};
|
||||||
let system = System::new();
|
let system = System::new();
|
||||||
Arbiter::current().spawn(execution);
|
Arbiter::current().spawn(execution);
|
||||||
if let Err(err) = system.run() {
|
system.run()?;
|
||||||
tracing::error!(?err, "")
|
Ok(())
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init_logging() {
|
pub fn init_logging() {
|
||||||
|
|
Loading…
Reference in a new issue