24
24
Literal ,
25
25
Optional ,
26
26
Protocol ,
27
- Union ,
28
27
cast ,
29
28
overload ,
30
29
)
31
30
from urllib import parse
32
31
33
- import httpx
34
32
import requests
35
33
from typing_extensions import Self , TypeVar
36
34
@@ -476,28 +474,12 @@ class UidAlreadyExistsError(exceptions.AlreadyExistsError):
476
474
477
475
default_message = 'The user with the provided uid already exists'
478
476
479
- def __init__ (
480
- self ,
481
- message : str ,
482
- cause : Optional [Exception ],
483
- http_response : Optional [Union [httpx .Response , requests .Response ]],
484
- ) -> None :
485
- super ().__init__ (message , cause , http_response )
486
-
487
477
488
478
class EmailAlreadyExistsError (exceptions .AlreadyExistsError ):
489
479
"""The user with the provided email already exists."""
490
480
491
481
default_message = 'The user with the provided email already exists'
492
482
493
- def __init__ (
494
- self ,
495
- message : str ,
496
- cause : Optional [Exception ],
497
- http_response : Optional [Union [httpx .Response , requests .Response ]],
498
- ) -> None :
499
- super ().__init__ (message , cause , http_response )
500
-
501
483
502
484
class InsufficientPermissionError (exceptions .PermissionDeniedError ):
503
485
"""The credential used to initialize the SDK lacks required permissions."""
@@ -507,169 +489,70 @@ class InsufficientPermissionError(exceptions.PermissionDeniedError):
507
489
'https://firebase.google.com/docs/admin/setup for details '
508
490
'on how to initialize the Admin SDK with appropriate permissions' )
509
491
510
- def __init__ (
511
- self ,
512
- message : str ,
513
- cause : Optional [Exception ],
514
- http_response : Optional [Union [httpx .Response , requests .Response ]],
515
- ) -> None :
516
- super ().__init__ (message , cause , http_response )
517
-
518
492
519
493
class InvalidDynamicLinkDomainError (exceptions .InvalidArgumentError ):
520
494
"""Dynamic link domain in ActionCodeSettings is not authorized."""
521
495
522
496
default_message = 'Dynamic link domain specified in ActionCodeSettings is not authorized'
523
497
524
- def __init__ (
525
- self ,
526
- message : str ,
527
- cause : Optional [Exception ],
528
- http_response : Optional [Union [httpx .Response , requests .Response ]],
529
- ) -> None :
530
- super ().__init__ (message , cause , http_response )
531
-
532
498
533
499
class InvalidIdTokenError (exceptions .InvalidArgumentError ):
534
500
"""The provided ID token is not a valid Firebase ID token."""
535
501
536
502
default_message = 'The provided ID token is invalid'
537
503
538
- def __init__ (
539
- self ,
540
- message : str ,
541
- cause : Optional [Exception ] = None ,
542
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
543
- ) -> None :
544
- super ().__init__ (message , cause , http_response )
545
-
546
504
547
505
class PhoneNumberAlreadyExistsError (exceptions .AlreadyExistsError ):
548
506
"""The user with the provided phone number already exists."""
549
507
550
508
default_message = 'The user with the provided phone number already exists'
551
509
552
- def __init__ (
553
- self ,
554
- message : str ,
555
- cause : Optional [Exception ],
556
- http_response : Optional [Union [httpx .Response , requests .Response ]],
557
- ) -> None :
558
- super ().__init__ (message , cause , http_response )
559
-
560
510
561
511
class UnexpectedResponseError (exceptions .UnknownError ):
562
512
"""Backend service responded with an unexpected or malformed response."""
563
513
564
- def __init__ (
565
- self ,
566
- message : str ,
567
- cause : Optional [Exception ] = None ,
568
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
569
- ) -> None :
570
- super ().__init__ (message , cause , http_response )
571
-
572
514
573
515
class UserNotFoundError (exceptions .NotFoundError ):
574
516
"""No user record found for the specified identifier."""
575
517
576
518
default_message = 'No user record found for the given identifier'
577
519
578
- def __init__ (
579
- self ,
580
- message : str ,
581
- cause : Optional [Exception ] = None ,
582
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
583
- ) -> None :
584
- super ().__init__ (message , cause , http_response )
585
-
586
520
587
521
class EmailNotFoundError (exceptions .NotFoundError ):
588
522
"""No user record found for the specified email."""
589
523
590
524
default_message = 'No user record found for the given email'
591
525
592
- def __init__ (
593
- self ,
594
- message : str ,
595
- cause : Optional [Exception ] = None ,
596
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
597
- ) -> None :
598
- super ().__init__ (message , cause , http_response )
599
-
600
526
601
527
class TenantNotFoundError (exceptions .NotFoundError ):
602
528
"""No tenant found for the specified identifier."""
603
529
604
530
default_message = 'No tenant found for the given identifier'
605
531
606
- def __init__ (
607
- self ,
608
- message : str ,
609
- cause : Optional [Exception ] = None ,
610
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
611
- ) -> None :
612
- super ().__init__ (message , cause , http_response )
613
-
614
532
615
533
class TenantIdMismatchError (exceptions .InvalidArgumentError ):
616
534
"""Missing or invalid tenant ID field in the given JWT."""
617
535
618
- def __init__ (self , message : str ) -> None :
619
- super ().__init__ (message )
620
-
621
536
622
537
class ConfigurationNotFoundError (exceptions .NotFoundError ):
623
538
"""No auth provider found for the specified identifier."""
624
539
625
540
default_message = 'No auth provider found for the given identifier'
626
541
627
- def __init__ (
628
- self ,
629
- message : str ,
630
- cause : Optional [Exception ] = None ,
631
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
632
- ) -> None :
633
- super ().__init__ (message , cause , http_response )
634
-
635
542
636
543
class UserDisabledError (exceptions .InvalidArgumentError ):
637
544
"""An operation failed due to a user record being disabled."""
638
545
639
546
default_message = 'The user record is disabled'
640
547
641
- def __init__ (
642
- self ,
643
- message : str ,
644
- cause : Optional [Exception ] = None ,
645
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
646
- ) -> None :
647
- super ().__init__ (message , cause , http_response )
648
-
649
548
650
549
class TooManyAttemptsTryLaterError (exceptions .ResourceExhaustedError ):
651
550
"""Rate limited because of too many attempts."""
652
551
653
- def __init__ (
654
- self ,
655
- message : str ,
656
- cause : Optional [Exception ] = None ,
657
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
658
- ) -> None :
659
- super ().__init__ (message , cause , http_response )
660
-
661
552
662
553
class ResetPasswordExceedLimitError (exceptions .ResourceExhaustedError ):
663
554
"""Reset password emails exceeded their limits."""
664
555
665
- def __init__ (
666
- self ,
667
- message : str ,
668
- cause : Optional [Exception ] = None ,
669
- http_response : Optional [Union [httpx .Response , requests .Response ]] = None ,
670
- ) -> None :
671
- super ().__init__ (message , cause , http_response )
672
-
673
556
674
557
_CODE_TO_EXC_TYPE = {
675
558
'CONFIGURATION_NOT_FOUND' : ConfigurationNotFoundError ,
0 commit comments