Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

HttpsError.__init__ does not pass message to super().__init__()

未關閉 適合新手
#314 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
85/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
python
領域
backend

研究方向

問題位於 src/firebase_functions/https_fn.py 檔案的 HttpsError.__init__ 方法(第251-266行)。將 super().__init__() 呼叫改為 super().__init__(message),以將錯誤訊息傳遞給父 Exception 類別。執行 https_fn 模組的測試套件,確認 str(err) 現在會回傳提供的訊息,且 err.args 被正確填入。

由索引模型根據 Issue 內容生成。

描述

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 https://github.com/firebase/functions-samples/issues/1137)

主要語言
Python
星號
167
分支
36
平均合併
4 天 3 小時
30 天內合併 PR
1

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

firebase/firebase-functions-python 的其他 Issue

查看 firebase/firebase-functions-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。