Skip to content

Commit

Permalink
add helpful error message to opening rocksdb (#989)
Browse files Browse the repository at this point in the history
show directions from
[readme](https://github.com/FuelLabs/fuel-core#outdated-database) in
error context during opening of rocksdb.
  • Loading branch information
Voxelot authored Feb 7, 2023
1 parent a8ec541 commit 6257fc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/fuel-core/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
IterDirection,
},
};
use anyhow::Context;
use fuel_core_chain_config::{
ChainConfigDb,
CoinConfig,
Expand Down Expand Up @@ -162,7 +163,7 @@ unsafe impl Sync for Database {}
impl Database {
#[cfg(feature = "rocksdb")]
pub fn open(path: &Path) -> DatabaseResult<Self> {
let db = RocksDb::default_open(path)?;
let db = RocksDb::default_open(path).context("Failed to open rocksdb, you may need to wipe a pre-existing incompatible db `rm -rf ~/.fuel/db`")?;

Ok(Database {
data: Arc::new(db),
Expand Down

0 comments on commit 6257fc2

Please sign in to comment.