@vardario/cognito-client 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/error.d.ts +3 -1
- package/lib/error.js +15 -14
- package/package.json +1 -1
package/lib/error.d.ts
CHANGED
|
@@ -362,8 +362,10 @@ export declare enum RevokeTokenException {
|
|
|
362
362
|
UnsupportedOperationException = "UnsupportedOperationException",
|
|
363
363
|
UnsupportedTokenTypeException = "UnsupportedTokenTypeException"
|
|
364
364
|
}
|
|
365
|
+
export type CognitoErrorType = 'CommonError' | 'InitAuthError' | 'RespondToAuthChallengeError' | 'SignUpError' | 'ConfirmSignUpError' | 'ChangePasswordError' | 'RevokeTokenError' | 'ForgotPasswordError' | 'ConfirmForgotPasswordError' | 'ResendConfirmationCodeError' | 'UpdateUserAttributesError' | 'VerifyUserAttributeError' | 'GlobalSignOutError';
|
|
365
366
|
export declare class CognitoError extends Error {
|
|
366
|
-
|
|
367
|
+
readonly errorType: CognitoErrorType;
|
|
368
|
+
constructor(message: string, errorType: CognitoErrorType);
|
|
367
369
|
}
|
|
368
370
|
export declare class CommonError extends CognitoError {
|
|
369
371
|
readonly cognitoException: CommonException;
|
package/lib/error.js
CHANGED
|
@@ -401,85 +401,86 @@ export var RevokeTokenException;
|
|
|
401
401
|
RevokeTokenException["UnsupportedTokenTypeException"] = "UnsupportedTokenTypeException";
|
|
402
402
|
})(RevokeTokenException || (RevokeTokenException = {}));
|
|
403
403
|
export class CognitoError extends Error {
|
|
404
|
-
constructor(message) {
|
|
404
|
+
constructor(message, errorType) {
|
|
405
405
|
super(message);
|
|
406
|
+
this.errorType = errorType;
|
|
406
407
|
}
|
|
407
408
|
}
|
|
408
409
|
export class CommonError extends CognitoError {
|
|
409
410
|
constructor(message, cognitoException) {
|
|
410
|
-
super(message);
|
|
411
|
+
super(message, 'CommonError');
|
|
411
412
|
this.cognitoException = cognitoException;
|
|
412
413
|
}
|
|
413
414
|
}
|
|
414
415
|
export class InitAuthError extends CognitoError {
|
|
415
416
|
constructor(message, cognitoException) {
|
|
416
|
-
super(message);
|
|
417
|
+
super(message, 'InitAuthError');
|
|
417
418
|
this.cognitoException = cognitoException;
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
export class RespondToAuthChallengeError extends CognitoError {
|
|
421
422
|
constructor(message, cognitoException) {
|
|
422
|
-
super(message);
|
|
423
|
+
super(message, 'RespondToAuthChallengeError');
|
|
423
424
|
this.cognitoException = cognitoException;
|
|
424
425
|
}
|
|
425
426
|
}
|
|
426
427
|
export class SignUpError extends CognitoError {
|
|
427
428
|
constructor(message, cognitoException) {
|
|
428
|
-
super(message);
|
|
429
|
+
super(message, 'SignUpError');
|
|
429
430
|
this.cognitoException = cognitoException;
|
|
430
431
|
}
|
|
431
432
|
}
|
|
432
433
|
export class ConfirmSignUpError extends CognitoError {
|
|
433
434
|
constructor(message, cognitoException) {
|
|
434
|
-
super(message);
|
|
435
|
+
super(message, 'ConfirmSignUpError');
|
|
435
436
|
this.cognitoException = cognitoException;
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
439
|
export class ChangePasswordError extends CognitoError {
|
|
439
440
|
constructor(message, cognitoException) {
|
|
440
|
-
super(message);
|
|
441
|
+
super(message, 'ChangePasswordError');
|
|
441
442
|
this.cognitoException = cognitoException;
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
445
|
export class RevokeTokenError extends CognitoError {
|
|
445
446
|
constructor(message, cognitoException) {
|
|
446
|
-
super(message);
|
|
447
|
+
super(message, 'RevokeTokenError');
|
|
447
448
|
this.cognitoException = cognitoException;
|
|
448
449
|
}
|
|
449
450
|
}
|
|
450
451
|
export class ForgotPasswordError extends CognitoError {
|
|
451
452
|
constructor(message, cognitoException) {
|
|
452
|
-
super(message);
|
|
453
|
+
super(message, 'ForgotPasswordError');
|
|
453
454
|
this.cognitoException = cognitoException;
|
|
454
455
|
}
|
|
455
456
|
}
|
|
456
457
|
export class ConfirmForgotPasswordError extends CognitoError {
|
|
457
458
|
constructor(message, cognitoException) {
|
|
458
|
-
super(message);
|
|
459
|
+
super(message, 'ConfirmForgotPasswordError');
|
|
459
460
|
this.cognitoException = cognitoException;
|
|
460
461
|
}
|
|
461
462
|
}
|
|
462
463
|
export class ResendConfirmationCodeError extends CognitoError {
|
|
463
464
|
constructor(message, cognitoException) {
|
|
464
|
-
super(message);
|
|
465
|
+
super(message, 'ResendConfirmationCodeError');
|
|
465
466
|
this.cognitoException = cognitoException;
|
|
466
467
|
}
|
|
467
468
|
}
|
|
468
469
|
export class UpdateUserAttributesError extends CognitoError {
|
|
469
470
|
constructor(message, cognitoException) {
|
|
470
|
-
super(message);
|
|
471
|
+
super(message, 'UpdateUserAttributesError');
|
|
471
472
|
this.cognitoException = cognitoException;
|
|
472
473
|
}
|
|
473
474
|
}
|
|
474
475
|
export class VerifyUserAttributeError extends CognitoError {
|
|
475
476
|
constructor(message, cognitoException) {
|
|
476
|
-
super(message);
|
|
477
|
+
super(message, 'VerifyUserAttributeError');
|
|
477
478
|
this.cognitoException = cognitoException;
|
|
478
479
|
}
|
|
479
480
|
}
|
|
480
481
|
export class GlobalSignOutError extends CognitoError {
|
|
481
482
|
constructor(message, cognitoException) {
|
|
482
|
-
super(message);
|
|
483
|
+
super(message, 'GlobalSignOutError');
|
|
483
484
|
this.cognitoException = cognitoException;
|
|
484
485
|
}
|
|
485
486
|
}
|