HttpsError.__init__ does not pass message to super().__init__()
還沒有人認領這個 Issue。
評估
研究方向
問題位於 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:
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) anderr.argsis().- Logging the exception directly (e.g.
logger.error(err)) or inspecting tracebacks in tests / unhandled contexts printsfirebase_functions.https_fn.HttpsErrorwith 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 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
firebase/firebase-functions-python 的其他 Issue
-
Add support for VPC direct connect可能已有人在做 @IzaakGough 於 104 天前認領。 未關閉feature-request
難度 4/5 3-5 天 新手友好度 48/100
firebase/firebase-functions-python#275 · 1 則留言 · 1 個 reaction ·
-
feature-request
難度 4/5 3-5 天 新手友好度 35/100
firebase/firebase-functions-python#271 · 3 則留言 ·
-
[Bug] stability_digest_payload_from_ce_payload fails with AttributeError: 'dict' object has no attribute 'split'可能重新可做 關聯的 PR 已關閉且未合併。 未關閉bug unable to reproduce
難度 3/5 1-2 天 新手友好度 55/100
firebase/firebase-functions-python#260 · 6 則留言 ·
-
feature-request
難度 5/5 一週以上 新手友好度 25/100
firebase/firebase-functions-python#249 · 2 則留言 ·
-
logging library doesn't support Exceptions可能已有人在做 @IzaakGough 於 127 天前認領。 未關閉feature-request
難度 4/5 3-5 天 新手友好度 52/100
firebase/firebase-functions-python#172 · 3 則留言 ·
查看 firebase/firebase-functions-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 3 天內回覆
-
Negation with "not" and "no" is ignored during sentiment analysis可能已有人在做 @vivek-3728 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
techcsispit/mess-mood#11 · 1 則留言 ·
-
changelog investigate
難度 2/5 1-3 小時 新手友好度 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
難度 2/5 1-3 小時 新手友好度 83/100
btclib-org/btclib-wallet#267 ·
維護者通常 1 天內回覆
-
good first issue tech-debt
難度 2/5 1-3 小時 新手友好度 85/100
knnmelprop/YAADO#111 ·