Description
In src/firebase_functions/https_fn.py, HttpsError.__init__ stores self.message = message but calls super().__init__() with no arguments:
https://github.com/firebase/firebase-functions-python/blob/main/src/firebase_functions/https_fn.py#L251-L266
def __init__(
self,
code: FunctionsErrorCode,
message: str,
details: _typing.Any | None = None,
):
self.code = code
self.message = message
self.details = details
if code not in _error_code_map:
raise ValueError(f"Unknown error code: ${code}.")
self._http_error_code = _error_code_map[code]
super().__init__()
Impact
Because message is not passed to super().__init__(message):
str(err) evaluates to "" (empty string) and err.args is ().
- Logging the exception directly (e.g.
logger.error(err)) or inspecting tracebacks in tests / unhandled contexts prints firebase_functions.https_fn.HttpsError with no message.
Suggested Fix
Pass message to super().__init__(message).
(Context: surfaced via firebase/functions-samples#1137)
Description
In
src/firebase_functions/https_fn.py,HttpsError.__init__storesself.message = messagebut callssuper().__init__()with no arguments:https://github.com/firebase/firebase-functions-python/blob/main/src/firebase_functions/https_fn.py#L251-L266
Impact
Because
messageis not passed tosuper().__init__(message):str(err)evaluates to""(empty string) anderr.argsis().logger.error(err)) or inspecting tracebacks in tests / unhandled contexts printsfirebase_functions.https_fn.HttpsErrorwith no message.Suggested Fix
Pass
messagetosuper().__init__(message).(Context: surfaced via firebase/functions-samples#1137)