Skip to content

[refactor][P2] panic→error 转换 5 处 fmt.Errorf(%v) 丢身份——本簇该形态的最大聚集点 #97

Closed

Description

@zy84338719

来源:2026-11-11 全矩阵深度代码审查(6 路并行扫描约 24 万行 Go)。判定已复核;行号基于 2026-11-11 的 main,动手前请核对现场。
归档索引:#95(本仓重构 backlog)

位置

common.go:56、64;switch.go:124;hook_manager.go:83、93

证据

err = fmt.Errorf("workflow: panic: %v\n%s", rec, debug.Stack())        // common.go:56 safeRun
aerr = fmt.Errorf("workflow: after hook panic: %v\n%s", rp, ...)       // common.go:64
err = fmt.Errorf("workflow: switch func panic: %v\n%s", r, ...)        // switch.go:124

(另有 hook_manager.go:83/93 before/after hook panic 两处)Runnable/Hook 以 panic 携带 error 时 errors.Is/As 全断链,且 Join 后(joinHookErr)根因排查更难。workflow 已 import async——收编载体现成。

建议

统一改 async.PanicError(带栈、errors.As 可辨;其 Unwrap 补齐见 concurrency 仓对应 issue),或抽本地 panicErr helper 对 error 型 panic 保 %w;5 处一次性收拢为 1 个 helper。

Activity

  1. added a commit that references this issue on Nov 11, 2026
  2. zy84338719 commented on Nov 11, 2026

    @zy84338719
    ContributorAuthor

    已在 v0.11.0 修复并发布 ✅

    变更内容

    本条修复(在 v0.11.0 的版本节里定位到):

    该版本 `v0.11.0` 的其余变更

    关联问题单:workflow#94、workflow#96、workflow#97、workflow#98、workflow#99。

    Release: https://github.com/oekit/workflow/releases/tag/v0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor重构机会(代码审查产出)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions