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 摘要。