Skip to content

refactor(error)!: Error::Cfb keeps its io::Error as the source, and limit refusals are Error::TooLarge (#899) - #916

Merged
DrunkOnJava merged 13 commits into
mainfrom
refactor/cfb-error-source
Oct 23, 2026
Merged

DrunkOnJava merged 13 commits into
mainfrom
refactor/cfb-error-source

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Error::Cfb(String) becomes Cfb { op, path, source: io::Error }, so Error::source() returns the I/O error and a caller can match on its kind. The five size-limit refusals that were Cfb become Error::TooLarge { what, size, limit }. Fixes #899.

Changes

  • src/error.rs: Cfb { op: &'static str, path: Option<String>, #[source] source: io::Error }, displayed as CFB {op} {path}: {source}, and TooLarge { what: String, size: u64, limit: u64 }. Both are documented field by field.
  • src/writer.rs: the 17 I/O sites keep their error, with op one of create, create_storage, create_stream, write, flush, open and rename. "dst has no filename component" (3 sites) is an Io error of kind InvalidInput, because it is a caller's mistake, not the container's. The stream too short for its 8-byte prefix is Malformed { what: "stream framing" }.
  • src/reader.rs: open_bytes' container open keeps its error. The file and in-memory buffer over OpenLimits::max_file_bytes, and a stream over its read limit before or during the read, are TooLarge.
  • src/metadata.rs: the container open and open_stream keep their error; the identity stream over its cap is TooLarge.
  • CHANGELOG.md: a breaking-change entry.

Nothing outside src/ constructs or matches Error::Cfb: the CLIs, the bindings, the tests and the fuzz targets only display it.

Testing

  • tools/check-local.sh: not run locally. CI builds, lints and runs the real-file, CLI and contract targets, whose writer and open-limit paths raise these errors.
  • End to end: cfb_roundtrip_delta (the writer on the real corpus), cli_real_files and fuzz_regressions run in this PR's CI.
  • IFC exporter / performance: N/A.

Audit-honesty checklist

  • README / docs reflect the current state after this PR
  • No limitation resolved or introduced
  • Commit messages describe what and why
  • No emojis
  • No private paths, personal email addresses, or internal jargon in committed files
  • Reverse-engineering finding: N/A

Legal and contribution hygiene

  • I agree this work is licensable under Apache-2.0
  • This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content

@DrunkOnJava
DrunkOnJava marked this pull request as ready for review October 23, 2026 14:03
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 23, 2026 15:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4c208c2a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/reader.rs Resolved
@DrunkOnJava
DrunkOnJava merged commit 370ce0c into main Oct 23, 2026
27 checks passed
@DrunkOnJava
DrunkOnJava deleted the refactor/cfb-error-source branch October 23, 2026 15:58
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error::Cfb drops the io::Error it wraps

1 participant