ErrorCode::getDescription()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
/**
3
 * This file is part of graze/gigya-client
4
 *
5
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @license https://github.com/graze/gigya-client/blob/master/LICENSE.md
11
 * @link    https://github.com/graze/gigya-client
12
 */
13
14
namespace Graze\Gigya\Response;
15
16
/**
17
 * Class ErrorCode.
18
 *
19
 * List of error codes taken from Gigya website
20
 *
21
 * @link    http://developers.gigya.com/display/GD/Response+Codes+and+Errors+REST
22
 */
23
class ErrorCode
24
{
25
    /** Success. */
26
    const OK = 0;
27
    /** Data is still being processed. Please query again for the response. */
28
    const DATA_PENDING = 100001;
29
    /** User canceled during the login process. */
30
    const ERROR_OPERATION_CANCELED = 200001;
31
    /** For reports purposes, when OK is returned but there were acceptable errors in the process. */
32
    const OK_WITH_ERRORS = 200008;
33
    /** The accounts have been linked successfully. */
34
    const ACCOUNTS_LINKED = 200009;
35
    /**
36
     * When a new account is created and the login identifier already exists, the server handles the conflict according
37
     * to the conflictHandling parameter. If saveProfileAndFail is passed, the profile data is saved, a registration
38
     * token is returned for account linking, and this error is returned.
39
     */
40
    const OK_WITH_ERROR_LOGIN_IDENTIFIER_EXISTS = 200010;
41
    /**
42
     * A method has been called that performs social login, but the registration process has not been finalized, or a
43
     * required field is missing from the user profile or data. See Accounts API Error Codes and Messages for more
44
     * information.
45
     */
46
    const ERROR_ACCOUNT_PENDING_REGISTRATION = 206001;
47
    /**
48
     * An account has already been verified and a user tries to log in with a loginID (usually an email address) whose
49
     * connection to the user has not been verified. See Accounts API Error Codes and Messages for more information.
50
     */
51
    const ERROR_ACCOUNT_PENDING_VERIFICATION = 206002;
52
    /**
53
     * The registration policy requires a loginID when a user uses Social Login to register to the site, but there are
54
     * no login identifiers or a password associated with the account. See Accounts API Error Codes and Messages for
55
     * more information.
56
     */
57
    const ERROR_ACCOUNT_MISSING_LOGIN_ID = 206003;
58
    /**
59
     * The API key is served by another data center. The error occurs when an API request is received at the wrong data
60
     * center.
61
     */
62
    const ERROR_INVALID_DATA_CENTER = 301001;
63
    /**
64
     * This error may be caused by various faults in the request. For example: wrong authentication header, non-secure
65
     * request that should be secured.
66
     */
67
    const ERROR_INVALID_REQUEST_FORMAT = 400001;
68
    /**
69
     * The method requires some parameters. One of the required parameters was not set in this method call. The error
70
     * message will include the name of the missing parameter.
71
     */
72
    const ERROR_MISSING_REQUIRED_PARAMETER = 400002;
73
    /**
74
     * A user tries to register or set the account information with an email or username that already exists in the
75
     * accounts database. See Accounts API Error Codes and Messages for more information.  Some possible response
76
     * messages are:.
77
     *
78
     * - If a chosen Username already exists the returned message is "Username already exists".
79
     * - If a chosen Email already exists the returned message is "Email already exists".
80
     */
81
    const ERROR_UNIQUE_IDENTIFIER_EXISTS = 400003;
82
    /** One of the parameters of this request has been set with a value which is not in the expected format. */
83
    const ERROR_INVALID_PARAMETER_FORMAT = 400004;
84
    /**
85
     * One of the parameters of this request has been set with a value which is not within the parameter's defined
86
     * value bounds. Please refer to the method's parameter table, and check the definition of valid values per
87
     * parameter. The error message will include the name of the specific parameter.
88
     */
89
    const ERROR_INVALID_PARAMETER_VALUE = 400006;
90
    /** Internal error. */
91
    const ERROR_DUPLICATE_VALUE = 400007;
92
    /** An OAuth2 error. See OAuth2 Error Response for more information. */
93
    const ERROR_INVALID_AUTHENTICATION_HEADER = 400008;
94
    /**
95
     * In accounts.register, whenever there is a validation error. Some possible response messages are:.
96
     *
97
     * - If input Password Doesn't meet policy requirements the returned message is "Password does not meet complexity
98
     * requirements".
99
     * - If input Password Confirmation does not match Password field the returned message is "Passwords
100
     * do not match".
101
     * - If any Invalid or unsupported input (all fields) is detected the returned message is "Invalid
102
     * %fieldname".
103
     */
104
    const ERROR_VALIDATION = 400009;
105
    /** An OAuth2 error. See OAuth2 Error Response for more information. */
106
    const ERROR_INVALID_REDIRECT_URI = 400011;
107
    /** An OAuth2 error. See OAuth2 Error Response for more information. */
108
    const ERROR_INVALID_RESPONSE_TYPE = 400012;
109
    /** An OAuth2 error. See OAuth2 Error Response for more information. */
110
    const ERROR_UNSUPPORTED_GRANT_TYPE = 400013;
111
    /** An OAuth2 error. See OAuth2 Error Response for more information. */
112
    const ERROR_INVALID_GRANT = 400014;
113
    /** An OAuth2 error. See OAuth2 Error Response for more information. */
114
    const ERROR_CODE_EXPIRED = 400015;
115
    /**
116
     * There was an attempt to write to fields from the client side. By default, only signed requests coming from the
117
     * server are allowed to write into the data fields.
118
     */
119
    const ERROR_SCHEMA_VALIDATION_FAILED = 400020;
120
    /**
121
     * The registration policy requires the user to pass a CAPTCHA test in order to register, and the CAPTCHA
122
     * verification has failed. See Accounts API Error Codes and Messages for more information.
123
     */
124
    const ERROR_CAPTCHA_VERIFICATION_FAILED = 400021;
125
    /** Used mostly for DS, where custom unique indexes are supported. */
126
    const ERROR_UNIQUE_INDEX_VALIDATION = 400022;
127
    /** When the internal type (string, int, date, etc) does not match the type of the provided value. */
128
    const ERROR_INVALID_TYPE_VALIDATION = 400023;
129
    /**
130
     * A validation error is returned whenever there is a data validation error regarding one of the following required
131
     * fields: username, password, secretQuestion, secretAnswer, email.
132
     */
133
    const ERROR_DYNAMIC_FIELDS_VALIDATION = 400024;
134
    /**
135
     * A write access error regarding one of the following required fields: username, password, secretQuestion,
136
     * secretAnswer, email.
137
     */
138
    const ERROR_WRITE_ACCESS_VALIDATION = 400025;
139
    /** Invalid regex format. */
140
    const ERROR_INVALID_FORMAT_VALIDATION = 400026;
141
    /**
142
     * A required value is missing or has an error in one of the following required fields: username, password,
143
     * secretQuestion, secretAnswer, email. Some possible response messages are:.
144
     *
145
     * - If CAPTCHA input is blank or incorrect the returned message is "The characters you entered didn't match the
146
     * word verification. Please try again".
147
     * - If a required field (all fields) is not complete the returned message is "This field is required".
148
     */
149
    const ERROR_REQUIRED_VALUE_VALIDATION = 400027;
150
    /** The email address provided has not been verified. */
151
    const ERROR_EMAIL_NOT_VERIFIED = 400028;
152
    /** An error was encountered while indexing the object.Internal error. */
153
    const ERROR_SCHEMA_CONFLICT = 400029;
154
    /**
155
     * This error is returned if a user logs in with a SAML provider, and multiple identities are not allowed, and a
156
     * call to socialize.addConnection or to socialize.removeConnection is attempted.
157
     */
158
    const ERROR_OPERATION_NOT_ALLOWED = 400030;
159
    /** With accounts.resetPassword when the provided credentials could not be verified. */
160
    const ERROR_SECURITY_VERIFICATION_FAILED = 400050;
161
    /** The provided API key is invalid. */
162
    const ERROR_INVALID_APIKEY_PARAMETER = 400093;
163
    /** The function is not supported by any of the currently connected providers. */
164
    const ERROR_NOT_SUPPORTED = 400096;
165
    /**
166
     * The user is attempting to access Gigya services from an insecure/unsupported browser. User should switch
167
     * browsers.
168
     */
169
    const ERROR_BROWSER_INSECURE = 400097;
170
    /** With accounts.tfa.importTFA or accounts.tfa.resetTFA when no such TFA provider exists. */
171
    const ERROR_NO_PROVIDERS = 400100;
172
    /** The containerID specified does not exist. */
173
    const ERROR_INVALID_CONTAINER_ID = 400103;
174
    /** User is not connected to the required network or to any network. */
175
    const ERROR_NOT_CONNECTED = 400106;
176
    /** The current domain does not match the domain configured for the api key. */
177
    const ERROR_INVALID_SITE_DOMAIN = 400120;
178
    /** An error originated from a provider. */
179
    const ERROR_PROVIDER_CONFIGURATION_ERROR = 400122;
180
    /**
181
     * Refers generally to any reached limits, either in Game Mechanics or in Comments. In Loyalty, when a user
182
     * performed more actions than the allowed daily cap (maximum actions per 24hs), or when a user performed actions
183
     * more frequently than the allowed frequency cap (minimum interval between consecutive actions). So the error can
184
     * be DailyCap exceeded or FreqCap exceeded. In commenting, the error is returned when a user reaches the daily
185
     * limit of new comments threads per stream.
186
     */
187
    const ERROR_LIMIT_REACHED = 400124;
188
    /** In comments/feed the spam cap was reached. */
189
    const ERROR_FREQUENCY_LIMIT_REACHED = 400125;
190
    /** In Gamification when the action is invalid. */
191
    const ERROR_INVALID_ACTION = 400126;
192
    /**
193
     * When the gamification method redeemPoints is called, and the user does not have enough points, the operation
194
     * fails and this error occurs.
195
     */
196
    const ERROR_INSUFFICIENT_POINTS_TO_REDEEM = 400127;
197
    /**
198
     * If Protect Against Account Harvesting policy is enabled and neither Email Validation nor CAPTCHA Validation
199
     * policies are enabled.
200
     */
201
    const ERROR_INVALID_POLICY_CONFIGURATION = 401000;
202
    /** When media items are not allowed for this category. */
203
    const ERROR_MEDIA_ITEMS_NOT_SUPPORTED = 401001;
204
    /**
205
     * If someone is trying to use Gigya to send an email with a URL that does not match any of the client's domains.
206
     */
207
    const ERROR_SUSPECTED_SPAM = 401010;
208
    /**
209
     * If accounts.login is attempted and the CAPTCHA threshold has been reached. The CAPTCHA threshold is set in the
210
     * site Policies (security.captcha.failedLoginThreshold policy).
211
     */
212
    const ERROR_LOGIN_FAILED_CAPTCHA_REQUIRED = 401020;
213
    /**
214
     * If accounts.login is attempted and the CAPTCHA threshold has been reached and the provided CAPTCHA text is
215
     * wrong. The CAPTCHA threshold is set in the site Policies (security.captcha.failedLoginThreshold policy).
216
     */
217
    const ERROR_LOGIN_FAILED_WRONG_CAPTCHA = 401021;
218
    /**
219
     * The password provided is not the correct, current password; however, it is a password previously associated with
220
     * the account. This may appear in the following cases:.
221
     *
222
     * - When accounts.login is attempted with a password that doesn't match the current password, but does match the
223
     *   previous one. In this case, the server will return this error with a message saying that "the password was
224
     *   modified on" the date when the current password was set.
225
     * - When accounts.resetPassword is attempted with a password that has previously been used with the account.
226
     *   In this case, the server will return this error with a message stating "invalid password: the provided
227
     *   password was already in use by this account".
228
     */
229
    const ERROR_OLD_PASSWORD_USED = 401030;
230
    /** You do not have permission to invoke the method. */
231
    const ERROR_FORBIDDEN = 403000;
232
    /**
233
     * The timestamp or expiration of the token used exceeded the allowed time window.
234
     * The most common cause for this error is when your server's clock is not accurately set. This causes a gap
235
     * between your time and Gigya's time. Even a gap of two minutes is enough to create this error. Please refer to
236
     * Signing requests for more details.
237
     */
238
    const ERROR_REQUEST_HAS_EXPIRED = 403002;
239
    /** The request is not signed with a valid signature. Please refer to Signing requests for more details. */
240
    const ERROR_INVALID_REQUEST_SIGNATURE = 403003;
241
    /**
242
     * The value of the nonce parameter that was passed with this request is not unique. Gigya requires that in each
243
     * REST API call the nonce string will be unique. If Gigya receives two API calls with the same nonce, the second
244
     * API call is rejected. Please refer to Signing requests for more details.
245
     */
246
    const ERROR_DUPLICATE_NONCE = 403004;
247
    /** The user ID that is passed is not valid for this site. */
248
    const ERROR_UNAUTHORIZED_USER = 403005;
249
    /** When sending the secret key in REST it has to be over HTTPS. */
250
    const ERROR_SECRET_SENT_OVER_HTTP = 403006;
251
    /**
252
     * Returned when a user lacks the necessary permissions to perform the requested action, or when the user's
253
     * credentials are not configured properly.
254
     */
255
    const ERROR_PERMISSION_DENIED = 403007;
256
    /** Cannot find an openId endpoint on the url or cannot find the username given for the openId login. */
257
    const ERROR_INVALID_OPENID_URL = 403008;
258
    /** The user session for this provider has expired. */
259
    const ERROR_PROVIDER_SESSION_EXPIRED = 403009;
260
    /** The request has an invalid secret key. */
261
    const ERROR_INVALID_SECRET = 403010;
262
    /** The session for this user has expired. */
263
    const ERROR_SESSION_HAS_EXPIRED = 403011;
264
    /** Requested user has no valid session. */
265
    const ERROR_NO_VALID_SESSION = 403012;
266
    /** We can't validate the request because the referrer header is missing. */
267
    const ERROR_MISSING_REQUEST_REFERRER = 403015;
268
    /** The user currently logged in to the requested provider is not the same as the one logged in to the site. */
269
    const ERROR_UNEXPECTED_PROVIDER_USER = 403017;
270
    /**
271
     * This operation needs a user permission and it was not requested. You may use the method
272
     * socialize.requestPermissions to request the user permission. After gaining user permission you may retry to
273
     * execute this operation.
274
     */
275
    const ERROR_PERMISSION_NOT_REQUESTED = 403022;
276
    /**
277
     * This operation needs a user permission and the user did not grant your application with the necessary
278
     * permission.
279
     */
280
    const ERROR_NO_USER_PERMISSION = 403023;
281
    /**
282
     * Limit reached: Status is a duplicate. This error occurs when a user shares content multiple times, and is
283
     * returned with the provider name, e.g., "provider" : "twitter".
284
     */
285
    const ERROR_PROVIDER_LIMIT_REACHED = 403024;
286
    /** Invalid OAuth2 token. Read more in Using Gigya's REST API in compliance with OAuth 2.0. */
287
    const ERROR_INVALID_TOKEN = 403025;
288
    /**
289
     * Returned from the accounts.isAvailableLoginID method, when Protect Against Account Harvesting policy is enabled.
290
     */
291
    const ERROR_UNAUTHORIZED_ACCESS_ERROR = 403026;
292
    /** Can't flag comment, it was approved by the moderator already. */
293
    const ERROR_APPROVED_BY_MODERATOR = 403031;
294
    /** The request is missing user credentials. */
295
    const ERROR_NO_USER_COOKIE = 403035;
296
    /** The relevant Gigya product is not enabled for this partner. */
297
    const ERROR_UNAUTHORIZED_PARTNER = 403036;
298
    /** Comments - Post denied when the user tried to review twice. */
299
    const ERROR_POST_DENIED = 403037;
300
    /** No login ticket in callback URL. */
301
    const ERROR_NO_LOGIN_TICKET = 403040;
302
    /**
303
     * A user has tried to log into an inactive account. See Accounts API Error Codes and Messages for more
304
     * information.
305
     */
306
    const ERROR_ACCOUNT_DISABLED = 403041;
307
    /**
308
     * A user passes an incorrect password or a login ID that doesn't exist in our accounts database. See Accounts API
309
     * Error Codes and Messages for more information.
310
     */
311
    const ERROR_INVALID_LOGIN_ID = 403042;
312
    /**
313
     * The username/email address provided by the user exists in the database but is associated with a different user.
314
     * See Accounts API Error Codes and Messages for more information.
315
     */
316
    const ERROR_LOGIN_IDENTIFIER_EXISTS = 403043;
317
    /**
318
     * A user under the age of 13 has tried to log in. For COPPA compliance (Children's Online Privacy Protection Act).
319
     * Please refer to the Age Limit section in the Policies guide.
320
     */
321
    const ERROR_UNDERAGE_USER = 403044;
322
    /** If Registration-as-a-Service (RaaS) is enabled for your site, but the storage size has not been configured. */
323
    const ERROR_INVALID_SITE_CONFIGURATION_ERROR = 403045;
324
    /**
325
     * There is no user with that username or email. In the "Forgot Password" screen of the Screen-sets tool, this
326
     * error is returned if a user fills in an email of a user that doesn't exist.
327
     */
328
    const ERROR_LOGIN_ID_DOES_NOT_EXIST = 403047;
329
    /** The daily API call limit has been reached. */
330
    const ERROR_API_RATE_LIMIT_EXCEEDED = 403048;
331
    /**
332
     * When accounts.login is attempted and the password change interval has passed since the last password change. The
333
     * interval is set in the site Policies (security.passwordChangeInterval policy).
334
     */
335
    const ERROR_PENDING_PASSWORD_CHANGE = 403100;
336
    /**
337
     * When accounts.login, accounts.socialLogin, accounts.finalizeRegistration, socialize.notifyLogin, or
338
     * socialize.login is called and the policy (in the site Policies) requires 2-factor authentication, and the device
339
     * is not already in the verified device list for the account. The first time the method is called, the device
340
     * needs to be registered, and for the following calls, the device needs to be verified.
341
     */
342
    const ERROR_ACCOUNT_PENDING_TFA_VERIFICATION = 403101;
343
    /**
344
     * When accounts.login, accounts.socialLogin, accounts.finalizeRegistration, socialize.notifyLogin, or
345
     * socialize.login is called and the policy (in the site Policies) requires 2-factor authentication, and the device
346
     * is not already in the verified device list for the account. The first time the method is called, the device
347
     * needs to be registered, and for the following calls, the device needs to be verified.
348
     */
349
    const ERROR_ACCOUNT_PENDING_TFA_REGISTRATION = 403102;
350
    /**
351
     * When there is an attempt to deactivate a TFA provider for a user (with accounts.tfa.deactivateProvider) or to
352
     * register a user (with accounts.tfa.initTFA) and the user did not login through the device in the last few
353
     * minutes.
354
     */
355
    const ERROR_ACCOUNT_PENDING_RECENT_LOGIN = 403110;
356
    /**
357
     * When accounts.login is attempted and the account is locked out or the originating IP is locked out. This occurs
358
     * after a set number of failed login attempts. The number is set in the site Policies -
359
     * security.accountLockout.failedLoginThreshold policy and security.ipLockout.hourlyFailedLoginThreshold policy.
360
     */
361
    const ERROR_ACCOUNT_TEMPORARILY_LOCKED_OUT = 403120;
362
    /** When the client performs an operation that is redundant. */
363
    const ERROR_REDUNDANT_OPERATION = 403200;
364
    /** When the provided app ID is different from the one configured for the site. */
365
    const ERROR_INVALID_APPLICATION_ID = 403201;
366
    /** In the comments server: category not found, in accounts: email verification failed. */
367
    const ERROR_NOT_FOUND = 404000;
368
    /** The friend user ID provided is not a friend for the current user. */
369
    const ERROR_FRIEND_NOT_FOUND = 404001;
370
    /** Comments - Category not found. */
371
    const ERROR_CATEGORY_NOT_FOUND = 404002;
372
    /** Caused by an invalid UID. */
373
    const ERROR_UID_NOT_FOUND = 404003;
374
    /** An embed.ly 404 error message returned when the URL is invalid. */
375
    const ERROR_INVALID_URL = 404004;
376
    /** Internal for Gigya JavaScript API. */
377
    const ERROR_INVALID_API_METHOD = 405001;
378
    /** When attempting to connect to a provider that is already connected or to link to an already linked account. */
379
    const ERROR_IDENTITY_EXISTS = 409001;
380
    /**
381
     * When calling accounts.getProfilePhoto, accounts.publishProfilePhoto or accounts.uploadProfilePhoto. The user
382
     * photo requested does not exist or the photo provided is not valid.
383
     */
384
    const ERROR_MISSING_USER_PHOTO = 409010;
385
    /**
386
     * There was an attempt to set or retrieve information in a counter that the system cannot find. See
387
     * accounts.incrementCounters.
388
     */
389
    const ERROR_COUNTER_NOT_REGISTERED = 409011;
390
    /** See 3rd Party Cookies for information about using gmid tickets. */
391
    const ERROR_INVALID_GMID_TICKET = 409012;
392
    /** When a mapped attribute value for the providerUID cannot be retrieved. */
393
    const ERROR_SAML_MAPPED_ATTRIBUTE_NOT_FOUND = 409013;
394
    /** When the SAML certificate cannot be retrieved. */
395
    const ERROR_SAML_CERTIFICATE_NOT_FOUND = 409014;
396
    /** Resource is no longer available. */
397
    const ERROR_GONE = 410000;
398
    /** Comments plugin received a request that was too large. */
399
    const ERROR_REQUEST_ENTITY_TOO_LARGE = 413001;
400
    /** Comments plugin received a comment with too much text. */
401
    const ERROR_COMMENT_TEXT_TOO_LARGE = 413002;
402
    /** The data store object size is too large, it is limited to 512KB. */
403
    const ERROR_OBJECT_TOO_LARGE = 413003;
404
    /** The profile photo is too large. */
405
    const ERROR_PROFILE_PHOTO_TOO_LARGE = 413004;
406
    /** General security warning. */
407
    const ERROR_GENERAL_SECURITY_WARNING = 500000;
408
    /** General server error. */
409
    const ERROR_GENERAL_SERVER_ERROR = 500001;
410
    /** General error during the login process. */
411
    const ERROR_SERVER_LOGIN_ERROR = 500002;
412
    /** For multiple Data Centers (DCs) when no default application can be found. */
413
    const ERROR_DEFAULT_APPLICATION_CONFIGURATION = 500003;
414
    /** Error while migrating old Facebook session to new Graph API Facebook session. */
415
    const ERROR_SESSION_MIGRATION_ERROR = 500014;
416
    /** General error from the provider. */
417
    const ERROR_PROVIDER_ERROR = 500023;
418
    /** Various network errors, e.g., when JSONP request fails. */
419
    const ERROR_NETWORK_ERROR = 500026;
420
    /** General database error. */
421
    const ERROR_DATABASE_ERROR = 500028;
422
    /**
423
     * There is no definition of provider application for this site. Please refer to Opening External Applications to
424
     * learn how to define provider application.
425
     */
426
    const ERROR_NO_PROVIDER_APPLICATION = 500031;
427
    /** When there is no target environment in the config file. */
428
    const ERROR_INVALID_ENVIRONMENT_CONFIG = 500033;
429
    /** Internal error. */
430
    const ERROR_ERROR_DURING_BACKEND_OPERATION = 500034;
431
    /** Client-side error. */
432
    const ERROR_TIMEOUT = 504001;
433
    /** A timeout that was defined in the request is out. */
434
    const ERROR_REQUEST_TIMEOUT = 504002;
435
436
    /**
437
     * @var array [CODE => [Name, Description]]
438
     */
439
    protected static $errors = [
440
        self::OK                                      => ['OK ', 'Success.'],
441
        self::DATA_PENDING                            => [
442
            'Data pending',
443
            'Data is still being processed. Please query again for the response.',
444
        ],
445
        self::ERROR_OPERATION_CANCELED                => [
446
            'Operation canceled',
447
            'User canceled during the login process.',
448
        ],
449
        self::OK_WITH_ERRORS                          => [
450
            'OK with errors',
451
            'For reports purposes, when OK is returned but there were acceptable errors in the process.',
452
        ],
453
        self::ACCOUNTS_LINKED                         => [
454
            'Accounts linked',
455
            'The accounts have been linked successfully.',
456
        ],
457
        self::OK_WITH_ERROR_LOGIN_IDENTIFIER_EXISTS   => [
458
            'OK with error login identifier exists',
459
            'When a new account is created and the login identifier already exists, the server handles the conflict according to the conflictHandling parameter. If saveProfileAndFail is passed, the profile data is saved, a registration token is returned for account linking, and this error is returned.',
460
        ],
461
        self::ERROR_ACCOUNT_PENDING_REGISTRATION      => [
462
            'Account pending registration',
463
            'A method has been called that performs social login, but the registration process has not been finalized, or a required field is missing from the user profile or data. See Accounts API Error Codes and Messages for more information.',
464
        ],
465
        self::ERROR_ACCOUNT_PENDING_VERIFICATION      => [
466
            'Account pending verification',
467
            'An account has already been verified and a user tries to log in with a loginID (usually an email address) whose connection to the user has not been verified. See Accounts API Error Codes and Messages for more information.',
468
        ],
469
        self::ERROR_ACCOUNT_MISSING_LOGIN_ID          => [
470
            'Account missing loginID',
471
            'The registration policy requires a loginID when a user uses Social Login to register to the site, but there are no login identifiers or a password associated with the account. See Accounts API Error Codes and Messages for more information.',
472
        ],
473
        self::ERROR_INVALID_DATA_CENTER               => [
474
            'Invalid data center',
475
            'The API key is served by another data center. The error occurs when an API request is received at the wrong data center.',
476
        ],
477
        self::ERROR_INVALID_REQUEST_FORMAT            => [
478
            'Invalid request format',
479
            'This error may be caused by various faults in the request. For example: wrong authentication header, non-secure request that should be secured.',
480
        ],
481
        self::ERROR_MISSING_REQUIRED_PARAMETER        => [
482
            'Missing required parameter',
483
            'The method requires some parameters. One of the required parameters was not set in this method call. The error message will include the name of the missing parameter.',
484
        ],
485
        self::ERROR_UNIQUE_IDENTIFIER_EXISTS          => [
486
            'Unique identifier exists',
487
            'A user tries to register or set the account information with an email or username that already exists in the accounts database. See Accounts API Error Codes and Messages for more information.  Some possible response messages are:
488
If a chosen Username already exists the returned message is "Username already exists".
489
If a chosen Email already exists the returned message is "Email already exists".',
490
        ],
491
        self::ERROR_INVALID_PARAMETER_FORMAT          => [
492
            'Invalid parameter format',
493
            'One of the parameters of this request has been set with a value which is not in the expected format.',
494
        ],
495
        self::ERROR_INVALID_PARAMETER_VALUE           => [
496
            'Invalid parameter value',
497
            'One of the parameters of this request has been set with a value which is not within the parameter\'s defined value bounds. Please refer to the method\'s parameter table, and check the definition of valid values per parameter. The error message will include the name of the specific parameter.',
498
        ],
499
        self::ERROR_DUPLICATE_VALUE                   => ['Duplicate value', 'Internal error.'],
500
        self::ERROR_INVALID_AUTHENTICATION_HEADER     => [
501
            'Invalid authentication header',
502
            'An OAuth2 error. See OAuth2 Error Response for more information.',
503
        ],
504
        self::ERROR_VALIDATION                        => [
505
            'Validation',
506
            'In accounts.register, whenever there is a validation error. Some possible response messages are:
507
If input Password Doesn\'t meet policy requirements the returned message is "Password does not meet complexity requirements".
508
If input Password Confirmation does not match Password field the returned message is "Passwords do not match".
509
If any Invalid or unsupported input (all fields) is detected the returned message is "Invalid %fieldname".',
510
        ],
511
        self::ERROR_INVALID_REDIRECT_URI              => [
512
            'Invalid redirect URI',
513
            'An OAuth2 error. See OAuth2 Error Response for more information.',
514
        ],
515
        self::ERROR_INVALID_RESPONSE_TYPE             => [
516
            'Invalid response type',
517
            'An OAuth2 error. See OAuth2 Error Response for more information.',
518
        ],
519
        self::ERROR_UNSUPPORTED_GRANT_TYPE            => [
520
            'Unsupported grant type',
521
            'An OAuth2 error. See OAuth2 Error Response for more information.',
522
        ],
523
        self::ERROR_INVALID_GRANT                     => [
524
            'Invalid grant',
525
            'An OAuth2 error. See OAuth2 Error Response for more information.',
526
        ],
527
        self::ERROR_CODE_EXPIRED                      => [
528
            'Code expired',
529
            'An OAuth2 error. See OAuth2 Error Response for more information.',
530
        ],
531
        self::ERROR_SCHEMA_VALIDATION_FAILED          => [
532
            'Schema validation failed',
533
            'There was an attempt to write to fields from the client side. By default, only signed requests coming from the server are allowed to write into the data fields.',
534
        ],
535
        self::ERROR_CAPTCHA_VERIFICATION_FAILED       => [
536
            'CAPTCHA verification failed',
537
            'The registration policy requires the user to pass a CAPTCHA test in order to register, and the CAPTCHA verification has failed. See Accounts API Error Codes and Messages for more information.',
538
        ],
539
        self::ERROR_UNIQUE_INDEX_VALIDATION           => [
540
            'Unique index validation ',
541
            'Used mostly for DS, where custom unique indexes are supported.',
542
        ],
543
        self::ERROR_INVALID_TYPE_VALIDATION           => [
544
            'Invalid type validation ',
545
            'When the internal type (string, int, date, etc) does not match the type of the provided value.',
546
        ],
547
        self::ERROR_DYNAMIC_FIELDS_VALIDATION         => [
548
            'Dynamic fields validation ',
549
            'A validation error is returned whenever there is a data validation error regarding one of the following required fields: username, password, secretQuestion, secretAnswer, email.',
550
        ],
551
        self::ERROR_WRITE_ACCESS_VALIDATION           => [
552
            'Write access validation',
553
            'A write access error regarding one of the following required fields: username, password, secretQuestion, secretAnswer, email.',
554
        ],
555
        self::ERROR_INVALID_FORMAT_VALIDATION         => ['Invalid format validation ', 'Invalid regex format.'],
556
        self::ERROR_REQUIRED_VALUE_VALIDATION         => [
557
            'Required value validation',
558
            'A required value is missing or has an error in one of the following required fields: username, password, secretQuestion, secretAnswer, email. Some possible response messages are:
559
If CAPTCHA input is blank or incorrect the returned message is "The characters you entered didn\'t match the word verification. Please try again".
560
If a required field (all fields) is not complete the returned message is "This field is required".',
561
        ],
562
        self::ERROR_EMAIL_NOT_VERIFIED                => [
563
            'Email not verified',
564
            'The email address provided has not been verified.',
565
        ],
566
        self::ERROR_SCHEMA_CONFLICT                   => [
567
            'Schema conflict',
568
            'An error was encountered while indexing the object.Internal error.',
569
        ],
570
        self::ERROR_OPERATION_NOT_ALLOWED             => [
571
            'Operation not allowed',
572
            'This error is returned if a user logs in with a SAML provider, and multiple identities are not allowed, and a call to socialize.addConnection or to socialize.removeConnection is attempted.',
573
        ],
574
        self::ERROR_SECURITY_VERIFICATION_FAILED      => [
575
            'Security verification failed ',
576
            'With accounts.resetPassword when the provided credentials could not be verified.',
577
        ],
578
        self::ERROR_INVALID_APIKEY_PARAMETER          => [
579
            'Invalid ApiKey parameter',
580
            'The provided API key is invalid.',
581
        ],
582
        self::ERROR_NOT_SUPPORTED                     => [
583
            'Not supported',
584
            'The function is not supported by any of the currently connected providers.',
585
        ],
586
        self::ERROR_BROWSER_INSECURE                  => [
587
            'Browser insecure',
588
            'The user is attempting to access Gigya services from an insecure/unsupported browser. User should switch browsers.',
589
        ],
590
        self::ERROR_NO_PROVIDERS                      => [
591
            'No providers',
592
            'With accounts.tfa.importTFA or accounts.tfa.resetTFA when no such TFA provider exists.',
593
        ],
594
        self::ERROR_INVALID_CONTAINER_ID              => [
595
            'Invalid containerID',
596
            'The containerID specified does not exist.',
597
        ],
598
        self::ERROR_NOT_CONNECTED                     => [
599
            'Not connected',
600
            'User is not connected to the required network or to any network.',
601
        ],
602
        self::ERROR_INVALID_SITE_DOMAIN               => [
603
            'Invalid site domain',
604
            'The current domain does not match the domain configured for the api key.',
605
        ],
606
        self::ERROR_PROVIDER_CONFIGURATION_ERROR      => [
607
            'Provider configuration error',
608
            'An error originated from a provider.',
609
        ],
610
        self::ERROR_LIMIT_REACHED                     => [
611
            'Limit reached',
612
            'Refers generally to any reached limits, either in Game Mechanics or in Comments. In Loyalty, when a user performed more actions than the allowed daily cap (maximum actions per 24hs), or when a user performed actions more frequently than the allowed frequency cap (minimum interval between consecutive actions). So the error can be DailyCap exceeded or FreqCap exceeded. In commenting, the error is returned when a user reaches the daily limit of new comments threads per stream.',
613
        ],
614
        self::ERROR_FREQUENCY_LIMIT_REACHED           => [
615
            'Frequency limit reached',
616
            'In comments/feed the spam cap was reached.',
617
        ],
618
        self::ERROR_INVALID_ACTION                    => [
619
            'Invalid action',
620
            'In Gamification when the action is invalid.',
621
        ],
622
        self::ERROR_INSUFFICIENT_POINTS_TO_REDEEM     => [
623
            'Insufficient points to redeem',
624
            'When the gamification method redeemPoints is called, and the user does not have enough points, the operation fails and this error occurs.',
625
        ],
626
        self::ERROR_INVALID_POLICY_CONFIGURATION      => [
627
            'Invalid policy configuration',
628
            'If Protect Against Account Harvesting policy is enabled and neither Email Validation nor CAPTCHA Validation policies are enabled.',
629
        ],
630
        self::ERROR_MEDIA_ITEMS_NOT_SUPPORTED         => [
631
            'Media items not supported',
632
            'When media items are not allowed for this category.',
633
        ],
634
        self::ERROR_SUSPECTED_SPAM                    => [
635
            'Suspected spam',
636
            'If someone is trying to use Gigya to send an email with a URL that does not match any of the client\'s domains.',
637
        ],
638
        self::ERROR_LOGIN_FAILED_CAPTCHA_REQUIRED     => [
639
            'Login Failed Captcha Required',
640
            'If accounts.login is attempted and the CAPTCHA threshold has been reached. The CAPTCHA threshold is set in the site Policies (security.captcha.failedLoginThreshold policy).',
641
        ],
642
        self::ERROR_LOGIN_FAILED_WRONG_CAPTCHA        => [
643
            'Login Failed Wrong Captcha',
644
            'If accounts.login is attempted and the CAPTCHA threshold has been reached and the provided CAPTCHA text is wrong. The CAPTCHA threshold is set in the site Policies (security.captcha.failedLoginThreshold policy).',
645
        ],
646
        self::ERROR_OLD_PASSWORD_USED                 => [
647
            'Old password used',
648
            'The password provided is not the correct, current password; however, it is a password previously associated with the account. This may appear in the following cases:
649
When accounts.login is attempted with a password that doesn\'t match the current password, but does match the previous one. In this case, the server will return this error with a message saying that "the password was modified on" the date when the current password was set.
650
When accounts.resetPassword is attempted with a password that has previously been used with the account. In this case, the server will return this error with a message stating "invalid password: the provided password was already in use by this account".',
651
        ],
652
        self::ERROR_FORBIDDEN                         => [
653
            'Forbidden',
654
            'You do not have permission to invoke the method.',
655
        ],
656
        self::ERROR_REQUEST_HAS_EXPIRED               => [
657
            'Request has expired',
658
            'The timestamp or expiration of the token used exceeded the allowed time window.
659
The most common cause for this error is when your server\'s clock is not accurately set. This causes a gap between your time and Gigya\'s time. Even a gap of two minutes is enough to create this error.
660
Please refer to Signing requests for more details.',
661
        ],
662
        self::ERROR_INVALID_REQUEST_SIGNATURE         => [
663
            'Invalid request signature',
664
            'The request is not signed with a valid signature. Please refer to Signing requests for more details.',
665
        ],
666
        self::ERROR_DUPLICATE_NONCE                   => [
667
            'Duplicate nonce',
668
            'The value of the nonce parameter that was passed with this request is not unique. Gigya requires that in each REST API call the nonce string will be unique. If Gigya receives two API calls with the same nonce, the second API call is rejected. Please refer to Signing requests for more details.',
669
        ],
670
        self::ERROR_UNAUTHORIZED_USER                 => [
671
            'Unauthorized user',
672
            'The user ID that is passed is not valid for this site.',
673
        ],
674
        self::ERROR_SECRET_SENT_OVER_HTTP             => [
675
            'Secret Sent Over Http',
676
            'When sending the secret key in REST it has to be over HTTPS.',
677
        ],
678
        self::ERROR_PERMISSION_DENIED                 => [
679
            'Permission denied',
680
            'Returned when a user lacks the necessary permissions to perform the requested action, or when the user\'s credentials are not configured properly.',
681
        ],
682
        self::ERROR_INVALID_OPENID_URL                => [
683
            'Invalid OpenID Url',
684
            'Cannot find an openId endpoint on the url or cannot find the username given for the openId login.',
685
        ],
686
        self::ERROR_PROVIDER_SESSION_EXPIRED          => [
687
            'Provider session expired',
688
            'The user session for this provider has expired.',
689
        ],
690
        self::ERROR_INVALID_SECRET                    => [
691
            'Invalid Secret',
692
            'The request has an invalid secret key.',
693
        ],
694
        self::ERROR_SESSION_HAS_EXPIRED               => [
695
            'Session has expired',
696
            'The session for this user has expired.',
697
        ],
698
        self::ERROR_NO_VALID_SESSION                  => [
699
            'No valid session',
700
            'Requested user has no valid session.',
701
        ],
702
        self::ERROR_MISSING_REQUEST_REFERRER          => [
703
            'Missing request referrer',
704
            'We can\'t validate the request because the referrer header is missing.',
705
        ],
706
        self::ERROR_UNEXPECTED_PROVIDER_USER          => [
707
            'Unexpected provider user',
708
            'The user currently logged in to the requested provider is not the same as the one logged in to the site.',
709
        ],
710
        self::ERROR_PERMISSION_NOT_REQUESTED          => [
711
            'Permission not requested',
712
            'This operation needs a user permission and it was not requested. You may use the method socialize.requestPermissions to request the user permission. After gaining user permission you may retry to execute this operation.',
713
        ],
714
        self::ERROR_NO_USER_PERMISSION                => [
715
            'No user permission',
716
            'This operation needs a user permission and the user did not grant your application with the necessary permission.',
717
        ],
718
        self::ERROR_PROVIDER_LIMIT_REACHED            => [
719
            'Provider limit reached',
720
            'Limit reached: Status is a duplicate. This error occurs when a user shares content multiple times, and is returned with the provider name, e.g., "provider" : "twitter".',
721
        ],
722
        self::ERROR_INVALID_TOKEN                     => [
723
            'Invalid token',
724
            'Invalid OAuth2 token. Read more in Using Gigya\'s REST API in compliance with OAuth 2.0.',
725
        ],
726
        self::ERROR_UNAUTHORIZED_ACCESS_ERROR         => [
727
            'Unauthorized access error',
728
            'Returned from the accounts.isAvailableLoginID method, when Protect Against Account Harvesting policy is enabled.',
729
        ],
730
        self::ERROR_APPROVED_BY_MODERATOR             => [
731
            'Approved by moderator',
732
            'Can\'t flag comment, it was approved by the moderator already.',
733
        ],
734
        self::ERROR_NO_USER_COOKIE                    => [
735
            'No user cookie',
736
            'The request is missing user credentials.',
737
        ],
738
        self::ERROR_UNAUTHORIZED_PARTNER              => [
739
            'Unauthorized partner',
740
            'The relevant Gigya product is not enabled for this partner.',
741
        ],
742
        self::ERROR_POST_DENIED                       => [
743
            'Post denied',
744
            'Comments - Post denied when the user tried to review twice.',
745
        ],
746
        self::ERROR_NO_LOGIN_TICKET                   => ['No login ticket', 'No login ticket in callback URL.'],
747
        self::ERROR_ACCOUNT_DISABLED                  => [
748
            'Account disabled',
749
            'A user has tried to log into an inactive account. See Accounts API Error Codes and Messages for more information.',
750
        ],
751
        self::ERROR_INVALID_LOGIN_ID                  => [
752
            'Invalid loginID',
753
            'A user passes an incorrect password or a login ID that doesn\'t exist in our accounts database. See Accounts API Error Codes and Messages for more information.',
754
        ],
755
        self::ERROR_LOGIN_IDENTIFIER_EXISTS           => [
756
            'Login identifier exists',
757
            'The username/email address provided by the user exists in the database but is associated with a different user. See Accounts API Error Codes and Messages for more information.',
758
        ],
759
        self::ERROR_UNDERAGE_USER                     => [
760
            'Underage user',
761
            'A user under the age of 13 has tried to log in. For COPPA compliance (Children\'s Online Privacy Protection Act). Please refer to the Age Limit section in the Policies guide.',
762
        ],
763
        self::ERROR_INVALID_SITE_CONFIGURATION_ERROR  => [
764
            'Invalid site configuration error',
765
            'If Registration-as-a-Service (RaaS) is enabled for your site, but the storage size has not been configured.',
766
        ],
767
        self::ERROR_LOGIN_ID_DOES_NOT_EXIST           => [
768
            'Login ID does not exist',
769
            'There is no user with that username or email. In the "Forgot Password" screen of the Screen-sets tool, this error is returned if a user fills in an email of a user that doesn\'t exist.',
770
        ],
771
        self::ERROR_API_RATE_LIMIT_EXCEEDED           => [
772
            'API Rate Limit Exceeded',
773
            'The daily API call limit has been reached.',
774
        ],
775
        self::ERROR_PENDING_PASSWORD_CHANGE           => [
776
            'Pending password change',
777
            'When accounts.login is attempted and the password change interval has passed since the last password change. The interval is set in the site Policies (security.passwordChangeInterval policy).',
778
        ],
779
        self::ERROR_ACCOUNT_PENDING_TFA_VERIFICATION  => [
780
            'Account Pending TFA Verification',
781
            'When accounts.login, accounts.socialLogin, accounts.finalizeRegistration, socialize.notifyLogin, or socialize.login is called and the policy (in the site Policies) requires 2-factor authentication, and the device is not already in the verified device list for the account. The first time the method is called, the device needs to be registered, and for the following calls, the device needs to be verified.',
782
        ],
783
        self::ERROR_ACCOUNT_PENDING_TFA_REGISTRATION  => [
784
            'Account Pending TFA Registration',
785
            'When accounts.login, accounts.socialLogin, accounts.finalizeRegistration, socialize.notifyLogin, or socialize.login is called and the policy (in the site Policies) requires 2-factor authentication, and the device is not already in the verified device list for the account. The first time the method is called, the device needs to be registered, and for the following calls, the device needs to be verified.',
786
        ],
787
        self::ERROR_ACCOUNT_PENDING_RECENT_LOGIN      => [
788
            'Account Pending Recent Login ',
789
            'When there is an attempt to deactivate a TFA provider for a user (with accounts.tfa.deactivateProvider) or to register a user (with accounts.tfa.initTFA) and the user did not login through the device in the last few minutes.',
790
        ],
791
        self::ERROR_ACCOUNT_TEMPORARILY_LOCKED_OUT    => [
792
            'Account Temporarily Locked Out',
793
            'When accounts.login is attempted and the account is locked out or the originating IP is locked out. This occurs after a set number of failed login attempts. The number is set in the site Policies - security.accountLockout.failedLoginThreshold policy and security.ipLockout.hourlyFailedLoginThreshold policy.',
794
        ],
795
        self::ERROR_REDUNDANT_OPERATION               => [
796
            'Redundant operation',
797
            'When the client performs an operation that is redundant.',
798
        ],
799
        self::ERROR_INVALID_APPLICATION_ID            => [
800
            'Invalid application ID',
801
            'When the provided app ID is different from the one configured for the site.',
802
        ],
803
        self::ERROR_NOT_FOUND                         => [
804
            'Not found',
805
            'In the comments server: category not found, in accounts: email verification failed.',
806
        ],
807
        self::ERROR_FRIEND_NOT_FOUND                  => [
808
            'Friend not found',
809
            'The friend user ID provided is not a friend for the current user.',
810
        ],
811
        self::ERROR_CATEGORY_NOT_FOUND                => ['Category not found', 'Comments - Category not found.'],
812
        self::ERROR_UID_NOT_FOUND                     => ['UID not found', 'Caused by an invalid UID.'],
813
        self::ERROR_INVALID_URL                       => [
814
            'Invalid URL',
815
            'An embed.ly 404 error message returned when the URL is invalid.',
816
        ],
817
        self::ERROR_INVALID_API_METHOD                => [
818
            'Invalid API method',
819
            'Internal for Gigya JavaScript API.',
820
        ],
821
        self::ERROR_IDENTITY_EXISTS                   => [
822
            'Identity exists',
823
            'When attempting to connect to a provider that is already connected or to link to an already linked account.',
824
        ],
825
        self::ERROR_MISSING_USER_PHOTO                => [
826
            'Missing user photo',
827
            'When calling accounts.getProfilePhoto, accounts.publishProfilePhoto or accounts.uploadProfilePhoto. The user photo requested does not exist or the photo provided is not valid.',
828
        ],
829
        self::ERROR_COUNTER_NOT_REGISTERED            => [
830
            'Counter not registered',
831
            'There was an attempt to set or retrieve information in a counter that the system cannot find. See accounts.incrementCounters.',
832
        ],
833
        self::ERROR_INVALID_GMID_TICKET               => [
834
            'Invalid gmid ticket',
835
            'See 3rd Party Cookies for information about using gmid tickets.',
836
        ],
837
        self::ERROR_SAML_MAPPED_ATTRIBUTE_NOT_FOUND   => [
838
            'SAML mapped attribute not found',
839
            'When a mapped attribute value for the providerUID cannot be retrieved.',
840
        ],
841
        self::ERROR_SAML_CERTIFICATE_NOT_FOUND        => [
842
            'SAML certificate not found',
843
            'When the SAML certificate cannot be retrieved.',
844
        ],
845
        self::ERROR_GONE                              => ['Gone', 'Resource is no longer available.'],
846
        self::ERROR_REQUEST_ENTITY_TOO_LARGE          => [
847
            'Request entity too large',
848
            'Comments plugin received a request that was too large.',
849
        ],
850
        self::ERROR_COMMENT_TEXT_TOO_LARGE            => [
851
            'Comment text too large',
852
            'Comments plugin received a comment with too much text.',
853
        ],
854
        self::ERROR_OBJECT_TOO_LARGE                  => [
855
            'Object too large',
856
            'The data store object size is too large, it is limited to 512KB.',
857
        ],
858
        self::ERROR_PROFILE_PHOTO_TOO_LARGE           => [
859
            'Profile photo too large',
860
            'The profile photo is too large.',
861
        ],
862
        self::ERROR_GENERAL_SECURITY_WARNING          => ['General security warning ', 'General security warning.'],
863
        self::ERROR_GENERAL_SERVER_ERROR              => ['General Server error', 'General server error.'],
864
        self::ERROR_SERVER_LOGIN_ERROR                => [
865
            'Server login error',
866
            'General error during the login process.',
867
        ],
868
        self::ERROR_DEFAULT_APPLICATION_CONFIGURATION => [
869
            'Default application configuration',
870
            'For multiple Data Centers (DCs) when no default application can be found.',
871
        ],
872
        self::ERROR_SESSION_MIGRATION_ERROR           => [
873
            'Session migration error',
874
            'Error while migrating old Facebook session to new Graph API Facebook session.',
875
        ],
876
        self::ERROR_PROVIDER_ERROR                    => ['Provider error', 'General error from the provider.'],
877
        self::ERROR_NETWORK_ERROR                     => [
878
            'Network error',
879
            'Various network errors, e.g., when JSONP request fails.',
880
        ],
881
        self::ERROR_DATABASE_ERROR                    => ['Database error', 'General database error.'],
882
        self::ERROR_NO_PROVIDER_APPLICATION           => [
883
            'No provider application',
884
            'There is no definition of provider application for this site. Please refer to Opening External Applications to learn how to define provider application.',
885
        ],
886
        self::ERROR_INVALID_ENVIRONMENT_CONFIG        => [
887
            'Invalid environment config',
888
            'When there is no target environment in the config file.',
889
        ],
890
        self::ERROR_ERROR_DURING_BACKEND_OPERATION    => ['Error during backend operation', 'Internal error.'],
891
        self::ERROR_TIMEOUT                           => ['Timeout', 'Client-side error.'],
892
        self::ERROR_REQUEST_TIMEOUT                   => [
893
            'Request Timeout',
894
            'A timeout that was defined in the request is out.',
895
        ],
896
    ];
897
898
    /**
899
     * @param int $errorCode
900
     *
901
     * @return string|null
902
     */
903 7
    public static function getName($errorCode)
904
    {
905 7
        return array_key_exists($errorCode, static::$errors) ?
906 6
            static::$errors[$errorCode][0] :
907 7
            null;
908
    }
909
910
    /**
911
     * @param int $errorCode
912
     *
913
     * @return string|null
914
     */
915 7
    public static function getDescription($errorCode)
916
    {
917 7
        return array_key_exists($errorCode, static::$errors) ?
918 6
            static::$errors[$errorCode][1] :
919 7
            null;
920
    }
921
}
922