mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
SMTP errors for client side (labs.smtp_show_server_errors)
This commit is contained in:
parent
9334187954
commit
2c1087b987
11 changed files with 88 additions and 43 deletions
|
|
@ -51,10 +51,19 @@ class Notifications
|
|||
const AccountAlreadyExists = 801;
|
||||
|
||||
const MailServerError = 901;
|
||||
const ClientViewError = 902;
|
||||
const UnknownNotification = 998;
|
||||
const UnknownError = 999;
|
||||
|
||||
static public function GetNotificationsMessage($iCode)
|
||||
/**
|
||||
* @staticvar array $aMap
|
||||
*
|
||||
* @param int $iCode
|
||||
* @param \Exception|null $oPrevious
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
static public function GetNotificationsMessage($iCode, $oPrevious = null)
|
||||
{
|
||||
static $aMap = array(
|
||||
self::InvalidToken => 'InvalidToken',
|
||||
|
|
@ -93,10 +102,16 @@ class Notifications
|
|||
self::DemoSendMessageError => 'DemoSendMessageError',
|
||||
self::AccountAlreadyExists => 'AccountAlreadyExists',
|
||||
self::MailServerError => 'MailServerError',
|
||||
self::ClientViewError => 'ClientViewError',
|
||||
self::UnknownNotification => 'UnknownNotification',
|
||||
self::UnknownError => 'UnknownError'
|
||||
);
|
||||
|
||||
if (self::ClientViewError === $iCode && $oPrevious instanceof \Exception)
|
||||
{
|
||||
return $oPrevious->getMessage();
|
||||
}
|
||||
|
||||
return isset($aMap[$iCode]) ? $aMap[$iCode].'['.$iCode.']' : 'UnknownNotification['.$iCode.']';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue