-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Logging exceptions rework #5118
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
Conversation
Ugh. This makes it much harder to review. Let's not do that until the entire codebase is linted. |
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.
Looks good, with a bit of comment cleanup
readthedocs/projects/tasks.py
Outdated
) | ||
return False | ||
|
||
|
||
# Exceptions under ``throws`` argument are considered ERROR from a Build | ||
# perspective but as a WARNING for the application itself. These exception are | ||
# logged as ``INFO`` and they are not sent to Sentry. |
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 don't understand this comment. "considered ERROR from a Build
perspective but as a WARNING for the application itself" -- what does that mean in practice? Does the build stop?
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.
A known error "by RTD's code" like "we didn't find the requirements.txt
you configured in the YAML file" is an ERROR that will make the build to stop. It's an error from the user's perspective.
Although, it's just a WARNING from the developer's perspective or the application (RTD's code) itself.
The build stops and the exception is logged as INFO/WARNING not as an ERROR.
If you have a better way to explain this we can adapt the comment. I'd appreciate.
These exceptions won't be logged into Sentry as ERROR but they will be logged as INFO since they are errors from a user's perspective (build failed) but not from an application perspective (our code didn't fail).
Depending on the exception, we want to log at different levels and in all the cases stop the build (execute `raise` again).
30885b3
to
1176c71
Compare
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.
Makes sense. 👍
This PR,
setup_vcs
and it raises an exception without stopping the build processBuildEnvironmentWarning
fromTask.throws
argument in tasks that is not neededupdate_docs
tasks to not log them in Sentry as ERRORpre-commit
Closes #5114
Closes #3856
Closes #4978
Related #5073
Related #5115