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

Give better error information when trying to read an invalid Data3D with zero points #264

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

asmaloney
Copy link
Owner

Instead of throwing ErrorInternal which is a bit misleading, throw a new exception ErrorData3DReadInvalidZeroRecords.

It looks like this:

trying to read an invalid Data3D with zero records - check for zero records before trying to read this Data3D section (ErrorInvalidZeroRecordsData3D): fileOffset cannot be 0; cvPathName=/data3D/0/points imageFileName=ZeroPointsInvalid.e57

Part of #262

(There will be another PR to change the way zero point CompressedVectors for Data3D are read/written so they don't have invalid offsets anymore.)

…ith zero points

Instead of throwing ErrorInternal which is a bit misleading, throw a new exception ErrorData3DReadInvalidZeroRecords.

It looks like this:

trying to read an invalid Data3D with zero records - check for zero records before trying to read this Data3D section (ErrorInvalidZeroRecordsData3D): fileOffset cannot be 0; cvPathName=/data3D/0/points imageFileName=ZeroPointsInvalid.e57

Part of #262
@asmaloney
Copy link
Owner Author

Let me know if you have any feedback @nh2.

As I mentioned, I have another PR to fix writing these zero-point Data3D sections (by writing an empty data packet) to avoid this error.

So the lib will be able to read what it writes properly 😄

@asmaloney asmaloney merged commit fbeeec4 into master Oct 24, 2023
23 checks passed
@asmaloney asmaloney deleted the improve-exception-message-zero-points branch October 24, 2023 12:15
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.

None yet

1 participant