Skip to content

Commit

Permalink
fix(logging): cannot migrate error message (#1199)
Browse files Browse the repository at this point in the history
* Unwrap last migration id or 0

* improve
  • Loading branch information
Alex6323 committed Mar 20, 2023
1 parent 81db125 commit 6cbde1b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/bin/inx-chronicle/migrations/mod.rs
Expand Up @@ -125,10 +125,11 @@ pub async fn migrate(db: &MongoDb) -> eyre::Result<()> {
migration.migrate(db).await?;
}
None => {
bail!(
"cannot migrate version {:?}, database is in invalid state",
last_migration
);
if let Some(id) = last_migration {
bail!("cannot migrate from version `{id}`; database is in invalid state");
} else {
bail!("migration failure; database is in invalid state");
}
}
}
}
Expand Down

0 comments on commit 6cbde1b

Please sign in to comment.