Display more information if loading bank fails at startup (#32457)

This commit is contained in:
Brooks 2023-07-11 12:31:58 -04:00 committed by GitHub
parent 466564686b
commit 0177a1629c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 2 deletions

View File

@ -268,7 +268,19 @@ fn bank_forks_from_snapshot(
accounts_update_notifier,
exit,
)
.expect("load bank from snapshot archives");
.unwrap_or_else(|err| {
error!(
"Failed to load bank: {err} \
\nfull snapshot archive: {} \
\nincremental snapshot archive: {}",
full_snapshot_archive_info.path().display(),
incremental_snapshot_archive_info
.as_ref()
.map(|archive| archive.path().display().to_string())
.unwrap_or("none".to_string()),
);
process::exit(1);
});
bank
} else {
let Some(bank_snapshot) = latest_bank_snapshot else {
@ -313,7 +325,14 @@ fn bank_forks_from_snapshot(
accounts_update_notifier,
exit,
)
.expect("load bank from local state");
.unwrap_or_else(|err| {
error!(
"Failed to load bank: {err} \
\nsnapshot: {}",
bank_snapshot.snapshot_path().display(),
);
process::exit(1);
});
bank
};