Skip to content

Risen BuildEnvironmentError exception from projects.tasks.py are logged #4109

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

Closed
humitos opened this issue May 17, 2018 · 2 comments · Fixed by #4495
Closed

Risen BuildEnvironmentError exception from projects.tasks.py are logged #4109

humitos opened this issue May 17, 2018 · 2 comments · Fixed by #4495
Assignees
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Milestone

Comments

@humitos
Copy link
Member

humitos commented May 17, 2018

There are some BuildEnvironmentError exceptions that we are riseing inside of the run_setup and run_build which end user messages that are being logged into our Sentry as errors but they are not errors to be reported to us at all since are just messages to the user.

Example: https://github.com/rtfd/readthedocs.org/blob/84cefc40f00083cbc74a473ffb4ef890294159a1/readthedocs/projects/tasks.py#L388-L390

We should find the way to catch them from the context manager and do not log to Sentry (log.error).

@humitos humitos added Improvement Minor improvement to code and removed Improvement Minor improvement to code labels May 17, 2018
@agjohnson agjohnson added this to the 2.5 milestone May 31, 2018
@agjohnson
Copy link
Contributor

We're consistently hitting sentry limits, so putting this on our next release milestone

@agjohnson agjohnson modified the milestones: 2.5, 2.6 Jun 7, 2018
@agjohnson agjohnson added the Accepted Accepted issue on our roadmap label Jun 8, 2018
@agjohnson agjohnson modified the milestones: 2.6, 2.7 Jul 17, 2018
@humitos
Copy link
Member Author

humitos commented Aug 8, 2018

I hit this again today.

I think we need to refactor our exceptions a little by creating specific BuildEnvironmentError for these cases and do not log them. For example,

https://github.com/rtfd/readthedocs.org/blob/fea0215bce79d8b7167b1d16eecddd525b6c7a3d/readthedocs/projects/tasks.py#L407-L426

Those three exceptions should be something like BuildDisabledError, VersionLockedError and YAMLParsingError. Then under our __exit__ method we need to check for these specific exceptions and do not log them:

https://github.com/rtfd/readthedocs.org/blob/fea0215bce79d8b7167b1d16eecddd525b6c7a3d/readthedocs/doc_builder/environments.py#L448-L451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
2 participants