diff options
| author | Teddy Wing | 2021-06-12 16:31:27 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2021-06-12 16:31:27 +0200 | 
| commit | 589545996e2b886e2c9e3ddb7b769d9e5e7959cf (patch) | |
| tree | 111978fc9a931a307969ac5d71ee58693aa62d96 /src/main.rs | |
| parent | f49b81b6d37709df8bf37a2361315dd3cab90fd7 (diff) | |
| download | reflectub-589545996e2b886e2c9e3ddb7b769d9e5e7959cf.tar.bz2 | |
run(): Add context to database errors
To allow us to work out where the error is coming from.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/src/main.rs b/src/main.rs index cd799ce..4b36264 100644 --- a/src/main.rs +++ b/src/main.rs @@ -125,9 +125,11 @@ async fn run() -> anyhow::Result<()> {      let repos = github::fetch_repos(username).await?; -    let mut db = database::Db::connect(&database_file)?; +    let mut db = database::Db::connect(&database_file) +        .context("unable to connect to database")?; -    db.create()?; +    db.create() +        .context("unable to create database")?;      // let mut joins = futures::stream::FuturesUnordered::new();      // let mut joins = Vec::with_capacity(repos.len()); | 
