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
Add log warning on challenge creation #2769
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check, why the test is failing.
privacyidea/lib/tokens/pushtoken.py
Outdated
raise ValidateError("Failed to submit message to firebase service.") | ||
log.warning("Failed to submit message to firebase service for token {0!s}." | ||
.format(self.token.serial)) | ||
raise ValueError("Failed to submit message to firebase service.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this to ValueError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really shouldn't be here because I already caught that one. I will fix it immediately.
Codecov Report
@@ Coverage Diff @@
## master #2769 +/- ##
=======================================
Coverage 96.62% 96.62%
=======================================
Files 162 162
Lines 20975 20976 +1
=======================================
+ Hits 20267 20268 +1
Misses 708 708
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry. One last comment
if not res: | ||
log.warning("Failed to submit message to firebase service for token {0!s}." | ||
.format(self.token.serial)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry for my late comment.
I was not quite sure about this.
But in theory a serial number could contain a special character or a German umlaut. If we print it in the log message this way, we will raise an exception.
So we should do
log.warnung(u"Failed to .....".format())
To allow logging unicode.
Thanks a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed now.
Add a warning to the log if submitting the challenge to firebase fails.
Closes #1668 and #2738