RheingoldRiver / mwcleric

mwclient wrapper
MIT License
13 stars 8 forks source link

Original error is swallowed even on `max_retries = 0` #32

Open KockaAdmiralac opened 1 month ago

KockaAdmiralac commented 1 month ago

I'm trying to edit a DataMap page from tiled-datamaps, and it occasionally throws a validation error that mwcleric tries to retry. I obviously don't want to retry these errors, so I set max_retries = 0, but since _retry_login_action is called anyways it swallows the original mwclient.errors.APIError (which has the info property I need for easier debugging of what went wrong) and instead throws a mwcleric.errors.RetriedLoginAndStillFailed (which only has error codes, and not specific error information, and that's only if max_retries > 0).

Any workaround for this? Right now, I'm letting it crash my program so that I can see both errors printed.

RheingoldRiver commented 1 month ago

i probably should throw this code out completely, it's there because Fandom kept kicking off your login session and also mwclient had some problems with their retry code which I think should be fixed now with 0.11

i'll try and get to that in the next couple days, but in the meantime if you send me a PR that makes it optional to engage (default False) during client setup I'll merge