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

DM-38602: Include failing VisitInfo serialization version in error message #684

Merged
merged 1 commit into from May 4, 2023

Conversation

parejkoj
Copy link
Contributor

@parejkoj parejkoj commented Apr 6, 2023

No description provided.

@parejkoj parejkoj changed the title Include failing VisitInfo serialization version in error message DM-38602: Include failing VisitInfo serialization version in error message Apr 6, 2023
std::to_string(SERIALIZATION_VERSION));
std::to_string(SERIALIZATION_VERSION) +
", found version " +
std::to_string(version) + " in file.");
Copy link
Member

Choose a reason for hiding this comment

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

Ending the log message in "in file. " is unnecessary and potentially confusing. This could lead a user to expect a path to appear after that, or think that the path did not appear for whatever reason.

@@ -360,6 +360,11 @@ def testPersistenceVersions(self):
self._testFitsRead(self.data1, os.path.join(dataDir, "visitInfo-version-3.fits"), 3)
self._testFitsRead(self.data1, os.path.join(dataDir, "visitInfo-version-4.fits"), 4)

# Check that reading a newer file raises a useful exception.
with self.assertRaisesRegex(TypeError,
r"Cannot read VisitInfo FITS version .* found version 999999"):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
r"Cannot read VisitInfo FITS version .* found version 999999"):
r"Cannot read VisitInfo FITS version > .* found version 999999"):

Copy link
Member

Choose a reason for hiding this comment

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

It'd be good to include all parts of the string that don't vary in here, and leave only the variable version number for regex. I am not sure where the comma should go before the "found version", but I'll leave it to you whether to include it or not.

@parejkoj parejkoj merged commit 9fe0c9f into main May 4, 2023
1 check passed
@parejkoj parejkoj deleted the tickets/DM-38602 branch May 4, 2023 23:33
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

3 participants