1: | <?php |
2: | /** |
3: | * This code is licensed under AGPLv3 license or Afterlogic Software License |
4: | * if commercial version of the product was purchased. |
5: | * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files. |
6: | */ |
7: | |
8: | namespace Aurora\System\Exceptions; |
9: | |
10: | /** |
11: | * @license https://www.gnu.org/licenses/agpl-3.0.html AGPL-3.0 |
12: | * @license https://afterlogic.com/products/common-licensing Afterlogic Software License |
13: | * @copyright Copyright (c) 2022, Afterlogic Corp. |
14: | */ |
15: | class ErrorCodes |
16: | { |
17: | // users |
18: | public const UserManager_AccountCreateFailed = 1002; |
19: | public const UserManager_AccountUpdateFailed = 1003; |
20: | public const UsersManager_UserCreateFailed = 1012; |
21: | |
22: | public const UserManager_AccountOldPasswordNotCorrect = 1020; |
23: | public const UserManager_AccountNewPasswordUpdateError = 1021; |
24: | public const UserManager_AccountNewPasswordRejected = 1022; |
25: | |
26: | // channels |
27: | public const ChannelsManager_ChannelAlreadyExists = 1801; |
28: | public const ChannelsManager_ChannelCreateFailed = 1802; |
29: | public const ChannelsManager_ChannelUpdateFailed = 1803; |
30: | |
31: | // validation |
32: | public const Validation_FieldIsEmpty = 1102; |
33: | public const Validation_FieldIsEmpty_OutInfo = 1104; |
34: | public const Validation_InvalidParameters = 1105; |
35: | public const Validation_InvalidChannelName = 1110; |
36: | |
37: | // container |
38: | public const Container_UndefinedProperty = 1601; |
39: | |
40: | // main |
41: | public const Main_UnknownError = 2002; |
42: | |
43: | // db |
44: | public const Db_ExceptionError = 3001; |
45: | |
46: | // Sabre |
47: | public const Sabre_PreconditionFailed = 5002; |
48: | |
49: | // Helpdesk |
50: | public const HelpdeskManager_UserAlreadyExists = 6001; |
51: | public const HelpdeskManager_UserCreateFailed = 6002; |
52: | public const HelpdeskManager_AccountAuthentication = 6004; |
53: | public const HelpdeskManager_AccountSystemAuthentication = 6008; |
54: | public const HelpdeskManager_UnactivatedUser = 6010; |
55: | |
56: | /** |
57: | * @param int $iCode |
58: | * @param array $aParams = array() |
59: | * @return string |
60: | */ |
61: | public static function GetMessageByCode($iCode, $aParams = array()) |
62: | { |
63: | return ''; |
64: | // static $aMessages = null; |
65: | // if (null === $aMessages) |
66: | // { |
67: | // $aMessages = array( |
68: | // self::UserManager_AccountCreateFailed =>\Aurora\System\Api::I18N('API/USERMANAGER_ACCOUNT_CREATE_FAILED'), |
69: | // self::UserManager_AccountUpdateFailed =>\Aurora\System\Api::I18N('API/USERMANAGER_ACCOUNT_UPDATE_FAILED'), |
70: | // |
71: | // self::UserManager_AccountOldPasswordNotCorrect =>\Aurora\System\Api::I18N('API/USERMANAGER_ACCOUNT_OLD_PASSWORD_NOT_CORRECT'), |
72: | // self::UserManager_AccountNewPasswordUpdateError =>\Aurora\System\Api::I18N('API/USERMANAGER_ACCOUNT_NEW_PASSWORD_UPDATE_ERROR'), |
73: | // self::UserManager_AccountNewPasswordRejected =>\Aurora\System\Api::I18N('API/USERMANAGER_ACCOUNT_NEW_PASSWORD_REJECTED'), |
74: | // |
75: | // self::ChannelsManager_ChannelAlreadyExists =>\Aurora\System\Api::I18N('API/CHANNELSMANAGER_CHANNEL_ALREADY_EXISTS'), |
76: | // self::ChannelsManager_ChannelCreateFailed =>\Aurora\System\Api::I18N('API/CHANNELSMANAGER_CHANNEL_CREATE_FAILED'), |
77: | // self::ChannelsManager_ChannelUpdateFailed =>\Aurora\System\Api::I18N('API/CHANNELSMANAGER_CHANNEL_UPDATE_FAILED'), |
78: | // |
79: | // self::Validation_FieldIsEmpty =>\Aurora\System\Api::I18N('API/VALIDATION_FIELD_IS_EMPTY'), |
80: | // self::Validation_FieldIsEmpty_OutInfo =>\Aurora\System\Api::I18N('API/VALIDATION_FIELD_IS_EMPTY_OUTINFO'), |
81: | // self::Validation_InvalidParameters =>\Aurora\System\Api::I18N('API/VALIDATION_INVALID_PARAMETERS'), |
82: | // self::Validation_InvalidChannelName =>\Aurora\System\Api::I18N('API/VALIDATION_INVALID_CHANNEL_NAME'), |
83: | // |
84: | // self::Container_UndefinedProperty =>\Aurora\System\Api::I18N('API/CONTAINER_UNDEFINED_PROPERTY'), |
85: | // |
86: | // self::Main_UnknownError =>\Aurora\System\Api::I18N('API/MAIN_UNKNOWN_ERROR'), |
87: | // |
88: | // self::Db_ExceptionError =>\Aurora\System\Api::I18N('API/DB_EXCEPTION_ERROR'), |
89: | // |
90: | // self::Sabre_PreconditionFailed =>\Aurora\System\Api::I18N('API/SABRE_PRECONDITION_FAILED') |
91: | // ); |
92: | // } |
93: | // |
94: | // return isset($aMessages[$iCode]) |
95: | // ? ((0 < count($aParams)) ? strtr($aMessages[$iCode], $aParams) : $aMessages[$iCode]) |
96: | // :\Aurora\System\Api::I18N('API/UNKNOWN_ERROR'); |
97: | } |
98: | } |
99: |