Skip to content

Commit

Permalink
Detailed error message on account switch failure for #1594
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Jul 7, 2024
1 parent 288ff23 commit 7a16529
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,13 @@ public function switchAccount(string $sEmail) : bool
if (!isset($aAccounts[$sEmail])) {
throw new ClientException(Notifications::AccountDoesNotExist);
}
$oAccount = AdditionalAccount::NewInstanceFromTokenArray(
$this, $aAccounts[$sEmail]
);
try {
$oAccount = AdditionalAccount::NewInstanceFromTokenArray(
$this, $aAccounts[$sEmail], true
);
} catch (\Throwable $e) {
throw new ClientException(Notifications::AccountSwitchFailed, $e);
}
if (!$oAccount) {
throw new ClientException(Notifications::AccountSwitchFailed);
}
Expand Down

0 comments on commit 7a16529

Please sign in to comment.