Modify error handling during login (see #10011)
Merge pull request #934 from jburel/rebased/develop/system-failure

Modify error handling during login (see #10011) (rebased onto develop)