engine: storage_err renders the whole error chain, not just the caption - #8
Merged
Merged
Conversation
|
Deployment failed for project wheel with the following error: Learn More: https://vercel.com/morgandri1s-projects?upgradeToPro=build-rate-limit |
Morgandri1
force-pushed
the
sdk/storage-err-preserves-cause
branch
from
September 6, 2026 17:48
2824156 to
ca6fb91
Compare
Every tables.rs function wraps its sqlite call in .with_context(|| "verb
noun") -- "writing t_reports/x", "reading t_reports/x" -- so the real
cause sits one level down. storage_err rendered it with e.to_string(),
which for anyhow::Error prints only the outermost context, so the
caption reached the caller and the cause ("no such table: t_reports")
never did. PM hit exactly this live on the reports table.
format!("{e:#}") walks the whole chain instead. Added ApiError: Debug
(harmless, and the test needs a way to inspect the rendered message
without reaching through IntoResponse) and a unit test proving both the
caption and the cause survive.
Morgandri1
force-pushed
the
sdk/storage-err-preserves-cause
branch
from
September 9, 2026 19:55
ca6fb91 to
decb67a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PM hit this live on the wheel-dev board:
wheel write reports/xanswered{"code":"invalid","message":"writing t_reports/x"}with no indication of the real cause. Every function intables.rswraps its sqlite call in.with_context(|| "verb noun")— "writing t_reports/x", "reading t_reports/x", etc — andstorage_err(the single chokepoint forls/read/write/rm/queryon table nodes) rendered the error withe.to_string(), which foranyhow::Errorprints only the outermost.with_context()layer. The cause sat one level down and never reached the caller.storage_err:format!("{e:#}")instead ofe.to_string()— walks the whole anyhow chain.ApiError: added#[derive(Debug)](harmless; needed so a test can inspect the rendered message without going throughIntoResponse).the_message_names_the_cause_the_context_was_wrapping, proving both the caption and the cause survive.Root cause of the table itself sometimes going missing is a separate, already-tracked issue (ADVERSARY 034 / QA BUG-022 — journal-mode write-proofing); this PR only fixes that the error message swallowed the diagnosis once it happened.
Test plan
cargo test -p wheel-engine— 268 passedcargo clippy -p wheel-engine --all-targets -- -D warnings— cleancargo fmt -p wheel-engine -- --check— clean