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

Fix TAXIICollectionSource.query() to propagate HTTPErrors #526

Merged
merged 2 commits into from
Aug 24, 2021

Conversation

chisholm
Copy link
Contributor

This PR changes TAXIICollectionSource.query() to propagate HTTPErrors instead of ignoring them. HTTP status code 416 is still ignored, since that can occur naturally while paging with TAXII 2.0. The scope of the try-except is reduced to the minimum, to ensure steps are not skipped.

Fixes #524
Fixes #525

instead of ignoring them.  Special-cased 416, since that can
occur naturally while paging with TAXII 2.0.
@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2021

Codecov Report

Merging #526 (a3d1056) into master (6e7e9dd) will decrease coverage by 0.00%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #526      +/-   ##
==========================================
- Coverage   87.29%   87.28%   -0.01%     
==========================================
  Files         153      153              
  Lines       18023    18025       +2     
==========================================
+ Hits        15733    15734       +1     
- Misses       2290     2291       +1     
Impacted Files Coverage Δ
stix2/datastore/taxii.py 69.29% <83.33%> (-0.31%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e7e9dd...a3d1056. Read the comment docs.

@rpiazza
Copy link
Contributor

rpiazza commented Aug 24, 2021

Maybe it is me, but I missed the != 416, so it seemed like the comment contradicted the condition.

Maybe add "For other codes, propagate the exception"

@chisholm
Copy link
Contributor Author

Are you referring to a comment in the source code or this PR description?

@chisholm
Copy link
Contributor Author

I think you must have meant the code comment. I moved the comment outside the "if" statement, and added your suggestion.

@rpiazza rpiazza merged commit e64d23d into oasis-open:master Aug 24, 2021
@chisholm chisholm deleted the fix_taxii20_datasource branch August 24, 2021 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants