So current situation is that stuff like SteamAuthenticator(…).add() can cause SteamAuthenticatorError.
For example,
Traceback (mostrecentcalllast):
…
steam.guard.SteamAuthenticatorError: Failedtoaddauthenticator. Error: <EResult.DuplicateRequest: 29>
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 ifThis is obviously super prone to issues due to changes there, it would be way better to just include those fields in the exception.
So current situation is that stuff like
SteamAuthenticator(…).add()can causeSteamAuthenticatorError.For example,
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.
This is obviously super prone to issues due to changes there, it would be way better to just include those fields in the exception.