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

Add soft fail on 5xx Prawcore errors. #713

Merged
merged 3 commits into from
Dec 16, 2022

Conversation

OMEGARAZER
Copy link
Contributor

Adds except to stop 5xx errors killing run when going through user/submission lists.

Wasn't able to figure out how to write a test for this as it's an intermittent issue and not one we can knowingly get like 4xx errors. Been running with it for a few days and it's been working well though.

Also reduces some log spam by only printing the user being fetched rather than the whole list.

@Serene-Arc
Copy link
Owner

You can use the patch function from the unit testing function to manually through a praw exception for the test to simulate the server messing up.

@OMEGARAZER
Copy link
Contributor Author

You can use the patch function from the unit testing function to manually through a praw exception for the test to simulate the server messing up.

I can't seem to get patch to work for me in the way I need to for this (or at least how I'm trying?). I can get it to raise the exception directly but not indirectly where it shows these catching the exception. So any help you can give would be much appreciated.

@Serene-Arc
Copy link
Owner

Sure I'll take a look and add the tests to this PR.

@Serene-Arc
Copy link
Owner

Oh cool did you get them to work?

@OMEGARAZER
Copy link
Contributor Author

It appears so, If I remove my original patches the tests fail, killing BDFR but tests pass with them.

@Serene-Arc Serene-Arc merged commit 58e1d1a into Serene-Arc:development Dec 16, 2022
@OMEGARAZER OMEGARAZER mentioned this pull request Feb 2, 2023
3 tasks
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