Improve fatal error message for block read failures in BaseIndex::ProcessBlock #33659

pull ghost wants to merge 1 commits into bitcoin:master from changing 1 files +2 −2
  1. ghost commented at 8:48 AM on October 20, 2025: none

    When a block read operation fails in BaseIndex::ProcessBlock, the current error message only reports: Failed to read block %s from disk

    This message doesn't provide enough context to help developers or node operators diagnose the problem.

    What changed? The fatal error message now includes: The block hash (already existed) The block height A clearer description of the issue A hint to check whether the block exists in the database

    Before:

    FatalErrorf("Failed to read block %s from disk",
                 pindex->GetBlockHash().ToString());
    

    After

    FatalErrorf("Block reading error: Could not read block with hash %s from disk at height %d. Please check if the block exists in the database and is accessible.",
                 pindex->GetBlockHash().ToString(), pindex->nHeight);
    

    Benefit: More informative error messages help node operators debug issues faster.

  2. Enhance error message for block read failure
    Updated error message for block reading failure to provide more context.
    645128ee0a
  3. DrahtBot commented at 8:48 AM on October 20, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33659.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. stickies-v commented at 12:22 PM on October 20, 2025: contributor

    NACK, feels like busywork, don't see how this improves things.

  5. unknown closed this on Oct 20, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me