protected function handleUserError($errorNum)
    {
        switch ($errorNum) {
            case USER_INACTIVE:
                throw new NotActiveException(t($this->config->get('concrete.user.deactivation.message')));

            case USER_SESSION_EXPIRED:
                throw new SessionExpiredException(t('Your session has expired. Please sign in again.'));

            case USER_NON_VALIDATED:
                throw new NotValidatedException(t(
                    'This account has not yet been validated. Please check the email associated with this ' .
                    'account and follow the link it contains.'));
            case USER_PASSWORD_RESET:
                throw new UserPasswordResetException(t('This password has been reset.'));
            case USER_INVALID:
                if ($this->config->get('concrete.user.registration.email_registration')) {
                    $message = t('Invalid email address or password.');
                } else {
                    $message = t('Invalid username or password.');
                }

                throw new InvalidCredentialsException($message);
        }

        throw new \RuntimeException(t('An unknown login error occurred. Please try again.'));
    }