From b4a41f378398dab8158d8218a315fd0789aba638 Mon Sep 17 00:00:00 2001 From: Niharika-Sathish26 Date: Mon, 5 Jan 2026 14:32:48 +0530 Subject: [PATCH] Add type hints to FirebaseError in exceptions.py --- firebase_admin/exceptions.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/firebase_admin/exceptions.py b/firebase_admin/exceptions.py index 947f3680..1aff2fa9 100644 --- a/firebase_admin/exceptions.py +++ b/firebase_admin/exceptions.py @@ -30,6 +30,8 @@ Therefore it is always a good idea to have a handler specified for ``FirebaseError``, after all the subtype error handlers. """ +from typing import Optional +from requests import Response #: Error code for ``InvalidArgumentError`` type. @@ -95,7 +97,11 @@ class FirebaseError(Exception): this object. """ - def __init__(self, code, message, cause=None, http_response=None): + def __init__(self, + code: str, + message: str, + cause: Optional[Exception] = None, + http_response: Optional[Response] = None,): Exception.__init__(self, message) self._code = code self._cause = cause