Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Standardize exception handling

未关闭
#166 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
cpp, python
领域
backend

调研方向

首先检查列出的 dl-serve、calibration()、Entity、Interface._send_request()、ReturnCodes.py 和 ThrowReply 路径,然后阅读链接的 dripline-cpp issue 103。也请检查尚未审查的 Implementations。当 Caller、Execution 和 Details 之间的异常行为一致,并且预期的传播或捕获已得到验证时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Exception handling in dl-cpp: https://github.com/driplineorg/dripline-cpp/issues/103

The primary execution of most actions in dl-py takes place in C++, so most error handling will end up in the C++ code. Between C++ and Python the typical sequence of stages is Caller (Python) --> Execution (C++) --> Details (Python). Details includes things like doing calibrations. Most time is spent in the Execution and Details stages, and the Execution stage is typically responsible for the final error handling and making decisions about whether to exit the application. So we need to ensure that the error handling drops back to the C++ in the right ways.

Caller stage
  • dl-serve
    • Calls service::listen() and checks boolean return
    • Raises RuntimeError to exit if necessary
Execution stage

See https://github.com/driplineorg/dripline-cpp/issues/103

Details stage
  • ✅ AlertConsumer
    • Does not raise exceptions
  • ❌ Calibrate
    • calibration()
      • raises exceptions.DriplineValueError
      • This is the calibration decorator, which will be called when responding to a request
      • Therefore this is not the right use of DriplineValueError
  • ✅ Endpoint
    • Several functions
      • Raises only ThrowReply
  • ❓ Entity
    • Several functions
      • Raise ValueError
      • Question Is this right? Are these caught somewhere?
  • ✅ Interface
    • _send_request()
      • Raises DriplineError
      • Called by get(), set(), and cmd()
        • Not caught
        • Will pass exception up to the user of Interface
  • ✅ ReturnCodes.py
    • Does not raise exceptions
  • ✅ ThrowReply
    • Does not raise exceptions

I have not checked any code in Implementations.

主要语言
Python
星标
3
派生
6
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

driplineorg/dripline-python 的其他 Issue

查看 driplineorg/dripline-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。