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 #142: catch StopIteration and return InvalidProductError #143

Merged
merged 3 commits into from
May 21, 2024

Conversation

jteulade
Copy link
Contributor

@jteulade jteulade commented May 6, 2024

Your checklist for this pull request

Please review the guidelines for contributing to this repository.

  • Check the commit's or even all commits' message styles matches our requested structure.
  • Check your code additions will fail neither code linting checks nor unit test.

Description

Please describe your pull request.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Thank you!

@jteulade
Copy link
Contributor Author

jteulade commented May 13, 2024

In other products, I found the same usecase with a StopIteration we should catch.
I chose to add the fix here even if it's not for S2 products.

except (FileNotFoundError, IndexError):
LOGGER.warning(
except (FileNotFoundError, IndexError, StopIteration):
raise InvalidProductError(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

raise an exception instead of LOGGER. To confirm with @remi-braun

Copy link
Member

Choose a reason for hiding this comment

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

lessgo 🚀

@jteulade jteulade force-pushed the 142-stopiteration-s2-product branch from ec10e56 to a0f163c Compare May 21, 2024 09:52
@jteulade jteulade merged commit 7ad9b65 into main May 21, 2024
2 checks passed
@jteulade jteulade deleted the 142-stopiteration-s2-product branch May 21, 2024 09:54
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.

2 participants