[thermalctld] Print exception using repr(e) to get more information for 201911#109
Merged
liat-grozovik merged 1 commit intosonic-net:201911from Nov 3, 2020
Merged
Conversation
…onic-net#103) Allow exceptions to be printed even if they don't inherit from the `str` class Conflicts: sonic-thermalctld/scripts/thermalctld
liat-grozovik
approved these changes
Nov 3, 2020
Junchao-Mellanox
added a commit
to Junchao-Mellanox/sonic-buildimage
that referenced
this pull request
Nov 3, 2020
This was referenced Nov 3, 2020
vdahiya12
pushed a commit
to vdahiya12/sonic-platform-daemons
that referenced
this pull request
Apr 4, 2022
Currently, we are building both Python 2 and Python 3 versions of sonic-platform-common. However, we are currently not creating a Python 3 version of sonic-config-engine, so the build breaks. As I intend to remove this dependency in the near future anyway, I am removing it.
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.
Merge #103 to 201911.
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: