message: chore: panic with error message
diff: @@ -46,7 +46,8 @@ impl KeyValueBackend for RocksDBBackend {
  } else {
  builder.tempdir()
  };
  - if let Ok(cache_dir) = cache_dir_res {
  + match cache_dir_res {
  + Ok(cache_dir) => {
  // We minimize memory usage at all costs here.
  // If we want to use more memory, we should increase the limit of KeyValueMemory.
  let opts = {
  @@ -60,17 +61,24 @@ impl KeyValueBackend for RocksDBBackend {
  opts.set_min_write_buffer_number_to_merge(1);
  opts
  };
  - if let Ok(db) = DB::open(&opts, cache_dir.path()) {
  + match DB::open(&opts, cache_dir.path()) {
  + Ok(db) => {
  debug!(
  "open a key-value database({}) to save header map into disk",
  cache_dir.path().to_str().unwrap_or("")
  );
  self.resource.replace((cache_dir, db));
  - } else {
  - panic!("failed to open a key-value database to save header map into disk");
  }
  - } else {
  - panic!("failed to create a tempdir to save header map into disk");
  + Err(e) => panic!(
  + "failed to open a key-value database to save header map into disk: {}",
  + e
  + ),
  + }
  + }
  + Err(e) => panic!(
  + "failed to create a tempdir to save header map into disk: {}",
  + e
  + ),
  }
  }
  }
  