Skip to content
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

Embed: don't fail while querying sections with bad id #8084

Merged
merged 3 commits into from May 5, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Apr 9, 2021

No description provided.

@davidfischer
Copy link
Contributor

The approach looks fine but it looks like we have a check for broad exceptions.

@stsewd stsewd requested a review from a team April 15, 2021 22:30
query_result = body_obj(f'#{element_id}')
if query_result:
break
except Exception: # noqa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the exception we catch here more specific?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the exception comes from a third party package that is used from pyquery, I don't like having imports from packages that aren't listed in our requirements, also there may be more exceptions than the one reported, so we would still need to have a broader check. And, only the pyquery execution is inside the try block, so no need to scope it down.

@stsewd stsewd merged commit 4083525 into master May 5, 2021
@stsewd stsewd deleted the dont-fai-querying-section branch May 5, 2021 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants