aboutsummaryrefslogtreecommitdiff
path: root/src/diplonat.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-05-09 16:19:09 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-05-09 16:19:09 +0200
commit41caf6090ca8b24c162946054c48d59387d21200 (patch)
tree975b4f0b3928ddc0b353e3b80ed6f169a4e42509 /src/diplonat.rs
parent76c84042120b97ee98af6a1c40ab86aca062408a (diff)
downloaddiplonat-41caf6090ca8b24c162946054c48d59387d21200.tar.gz
diplonat-41caf6090ca8b24c162946054c48d59387d21200.zip
Add context to errors
Diffstat (limited to 'src/diplonat.rs')
-rw-r--r--src/diplonat.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/diplonat.rs b/src/diplonat.rs
index 089a5c7..38b2f8a 100644
--- a/src/diplonat.rs
+++ b/src/diplonat.rs
@@ -1,5 +1,5 @@
use igd::Gateway;
-use anyhow::Result;
+use anyhow::{Result, Context};
use crate::*;
@@ -10,11 +10,11 @@ pub struct DiplonatContext {
pub fn setup() -> Result<DiplonatContext> {
return Ok(DiplonatContext {
- config: config::load_env()?,
+ config: config::load_env().context("Unable to read configuration from environment")?,
//gateway: search_gateway(Default::default()).await
});
}
-pub fn dloop() -> bool {
+pub fn listen() -> bool {
return true;
}