Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore/skip invalid objects #889

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fr-an-k
Copy link
Contributor

@fr-an-k fr-an-k commented Dec 3, 2023

I have to handle many DXF that just gave error 0x800.
This PR adds a warning with line number if a DXF object/entity fails to parse.
It skips the rest of the object/entity and continues parsing rather than terminating.
Often the culprit is some exotic structure that I don't care about.
This PR gives me a way of logging (many cloud uploads) what went wrong, judge the severity and improve the code so it does parse.
It now does this by default, because IMHO that's what is expected, but a compile flag can be set to revert ot the old behavior (with improved warning).
The encode and out_** files ignore the invalid objects/entities as well, so a result can be produced.

@rurban rurban self-assigned this Dec 3, 2023
@rurban rurban added the cla_needed Waiting for the Copyright assignment label Dec 3, 2023
Copy link

codecov bot commented Dec 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c58344f) 73.77% compared to head (779ab07) 73.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #889   +/-   ##
=======================================
  Coverage   73.77%   73.77%           
=======================================
  Files           2        2           
  Lines         122      122           
=======================================
  Hits           90       90           
  Misses         32       32           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rurban rurban changed the title Ignore invalid Ignore/skip invalid objects Dec 4, 2023
@rurban
Copy link
Contributor

rurban commented Jan 2, 2024

I think this feature should be selectable at run-time, via some cmdline flag. Not compile-time.

@rurban
Copy link
Contributor

rurban commented Feb 9, 2024

I"ll redo that for 0.13.2, with a run-time flag. --force sounds good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla_needed Waiting for the Copyright assignment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants