forked from libersoft/zcs-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZimbraException.php
More file actions
33 lines (28 loc) · 846 Bytes
/
Copy pathZimbraException.php
File metadata and controls
33 lines (28 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* @author LiberSoft <info@libersoft.it>
* @license http://www.gnu.org/licenses/gpl.txt
*/
class ZimbraException extends Exception
{
public function __construct($code)
{
parent::__construct(self::getErrorMessage($code));
}
private static function getErrorMessage($code)
{
switch ($code) {
case 'account.ACCOUNT_EXISTS':
return "account already exists";
break;
case 'account.DISTRIBUTION_LIST_EXISTS':
return "distribution list already exists";
break;
case 'service.PROXY_ERROR':
return "error while proxying request to target server";
break;
default:
return sprintf("An unexpected error has occurred (%s)", $code);
}
}
}