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

Document how to handle action failures #157

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Gallaecio
Copy link
Contributor

@Gallaecio Gallaecio commented Dec 29, 2023

Resolves #118, resolves #119, resolves #120.

To do:

  • Test both snippets manually, make sure they work as expected.

@Gallaecio Gallaecio requested review from kmike and wRAR December 29, 2023 13:55
Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Merging #157 (ea2da8f) into main (9b67ef1) will decrease coverage by 0.12%.
Report is 61 commits behind head on main.
The diff coverage is 92.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #157      +/-   ##
==========================================
- Coverage   98.18%   98.07%   -0.12%     
==========================================
  Files          11       12       +1     
  Lines         828      985     +157     
==========================================
+ Hits          813      966     +153     
- Misses         15       19       +4     
Files Coverage Δ
scrapy_zyte_api/exceptions.py 100.00% <100.00%> (ø)
scrapy_zyte_api/_middlewares.py 94.59% <91.54%> (-1.96%) ⬇️

... and 5 files with indirect coverage changes


======================
Handling action errors
======================
Copy link
Member

Choose a reason for hiding this comment

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

There is a lot of code in this section; I wonder if we should make it a part of the library itself instead.

It seems like a general theme: if action failed, should the response be considered a success or a failure? The current default is success, but it seems that making it a failure is better (with an option to get back), as it allows to detect more issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deedfff does this for the middleware. Do we want to do something about the cache policy, or is it OK to keep that documentation-only?

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