[thermalctld] Print exception using repr(e) to get more information#103
Merged
jleveque merged 1 commit intosonic-net:masterfrom Oct 19, 2020
Merged
Conversation
liat-grozovik
approved these changes
Oct 18, 2020
jleveque
approved these changes
Oct 19, 2020
Contributor
|
@liat-grozovik Cherry-pick has conflict. |
Junchao-Mellanox
added a commit
to Junchao-Mellanox/sonic-platform-daemons
that referenced
this pull request
Nov 2, 2020
…onic-net#103) Allow exceptions to be printed even if they don't inherit from the `str` class Conflicts: sonic-thermalctld/scripts/thermalctld
vdahiya12
pushed a commit
to vdahiya12/sonic-platform-daemons
that referenced
this pull request
Apr 4, 2022
…nic-net#103) As part of consolidating all common Python-based functionality into the new sonic-py-common package, this pull request migrates from importing the sonic-daemon-base package to importing the sonic-py-common package. This is the next step toward resolving sonic-net/sonic-buildimage#4999. - Also reorganize imports for consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did this?
The existing code print exception like:
And it would print empty string if the exception class doesn't implement str. And the empty string is useless for debugging.
How to fix it?
Always print the exception using repr(e), like: