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 小时 新手友好度 72/100
Juniper/ansible-junos-stdlib#904 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
pollen-robotics/reachy_mini#1457 ·
维护者通常 1 天内回复
-
area:runtime good first issue
难度 2/5 1-3 小时 新手友好度 72/100
WATonomous/wato_f1tenth#39 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
FireDynamics/fdsreader#123 ·
-
难度 1/5 1 小时以内 新手友好度 85/100