You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make EResult (or the full response) accessible in SteamAuthenticatorError. #357
Now that's a pretty easy to catch that error, telling the user to first have it log off the old instance, hence duplicate.
Just, we can't really distinguish those errors unless we do some ugly string stuff on that returned string.
# "Failed to add authenticator. Error: <EResult.DuplicateRequest: 29>"ifstr(e).startswith("Failed to add authenticator. Error: <EResult."):
error_string=str(e)[45:-1] # "DuplicateRequest: 29"error_label, error_num=error_string.split(": ")
fromsteam.enumsimportEResulterror_label=EResult[error_label]
error_num=EResult(int(error_num))
iferror_label==error_num:
error=error_label# end ififerror==EResult.DuplicateRequest:
exit('Already have set an authenticator in another app')
# end if# end if
This is obviously super prone to issues due to changes there, it would be way better to just include those fields in the exception.
SteamAuthenticatorError should really inherit from steam.exceptions.SteamError. And then any places where it sets the eresult should be passed as parameter. This looks like a straightforward change
Activity
rossengeorgiev commentedon Sep 27, 2021
That's a good point.
steam/steam/guard.py
Lines 469 to 470 in 061ca33
SteamAuthenticatorErrorshould really inherit fromsteam.exceptions.SteamError. And then any places where it sets theeresultshould be passed as parameter. This looks like a straightforward changeluckydonald commentedon Sep 28, 2021
I can see if I have time to do a PR
Upgrade SteamAuthenticatorError to have the eresult available where t…
luckydonald commentedon Sep 28, 2021
Made one.