Skip to content

Reject unsupported export extensions - #711

Draft
DJ8520 wants to merge 1 commit into
HakanSeven12:mainfrom
DJ8520:agent/reject-unsupported-export-extensions
Draft

Reject unsupported export extensions#711
DJ8520 wants to merge 1 commit into
HakanSeven12:mainfrom
DJ8520:agent/reject-unsupported-export-extensions

Conversation

@DJ8520

@DJ8520 DJ8520 commented Aug 8, 2026

Copy link
Copy Markdown

What changed

  • Validate native save/export target extensions before serialization.
  • Reject missing or unsupported extensions with an error that names the supported .dwg and .dxf formats.
  • Add a unit regression proving .pdf fails without creating a mislabeled output file.

Why

--export input.dxf output.pdf previously fell through to the default DWG writer, exited successfully, and produced DWG bytes under a .pdf filename.

Impact

Headless callers now receive a non-zero exit and actionable format guidance instead of silently receiving corrupt-by-contract output. Existing DWG and DXF save paths are unchanged.

Validation

  • cargo test --release --locked --lib io::save_failure_tests::unsupported_output_extension_is_rejected_before_write -- --exact --nocapture
  • Production release build followed by a real --export ... out.pdf probe: exit 1, no output file, supported formats named.
  • Existing io::layer_roundtrip_tests suite: 4 passed.

@HakanSeven12

HakanSeven12 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Let me know when you finish it

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.

2 participants