Skip to content

Display hardware info in footer; close open file handlers; better error handling#989

Merged
rdmark merged 9 commits intodevelopfrom
rdmark-issue-980
Nov 16, 2022
Merged

Display hardware info in footer; close open file handlers; better error handling#989
rdmark merged 9 commits intodevelopfrom
rdmark-issue-980

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Nov 16, 2022

Also improves error handling in get_properties_by_drive_name(), as called out by Sonar.

except (IOError, ValueError, EOFError, TypeError) as error:
logging.error(str(error))
else:
hardware = "?"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe set this to "Unhandled OS" or something like that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, I guess that's more informative.

The reason that I fell back to the question mark is because it's cumbersome to localize strings that come from the common package. You need to pass some kind of token that is then converted to a string in the Flask app. But anyways, it's going to be ultra rare for these fallbacks to be displayed to end users I think, so it's ok to leave them unlocalized probably.

Copy link
Copy Markdown
Member

@nucleogenic nucleogenic left a comment

Choose a reason for hiding this comment

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

Tested in Docker, looks and works well!

@rdmark rdmark changed the title Display hardware info in footer Display hardware info in footer; close open file handlers; better error handling Nov 16, 2022
@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@rdmark rdmark merged commit 4645e8c into develop Nov 16, 2022
@rdmark rdmark deleted the rdmark-issue-980 branch November 16, 2022 06:28
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.

3 participants