Commit e4d3fefe authored by Romain Bignon's avatar Romain Bignon Committed by Romain Bignon

bnporc: fail on unknown error codes

parent a0c07797
......@@ -203,12 +203,15 @@ class LoginPage(JsonPage):
msg = self.get('message')
wrongpass_codes = [201, 21510, 203, 202, 1001]
actionNeeded_codes = [21501, 3, 4]
if error in wrongpass_codes:
raise BrowserIncorrectPassword(msg)
elif error == 21: # "Ce service est momentanément indisponible. Veuillez renouveler votre demande ultérieurement." -> In reality, account is blocked because of too much wrongpass
raise ActionNeeded(u"Compte bloqué")
else:
elif error in actionNeeded_codes:
raise ActionNeeded(msg)
else:
assert False, 'Unexpected error at login: "%s" (code=%s)' % (msg, error)
def login(self, username, password):
url = '/identification-wspl-pres/grille/%s' % self.get('data.grille.idGrille')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment