Better OOTB error handling
@imanali2237 已经在做这个了。
开始于 2026年6月30日。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript, node.js
调研方向
首先检查 Hapi.server 选项以及 issue 中描述的 routes.ext.onPreResponse.method() hook,包括当前如何使用 NODE_ENV。确定一种配置结构,以便选择不使用通用错误包装,同时保留安全的默认行为,然后补充对 development 和 production 行为的覆盖,并验证原始错误和 stack trace 的处理。
由索引模型根据 Issue 内容生成。
描述
Runtime
NodeJS
Runtime version
any
Module version
21
What problem are you trying to solve?
Whenever I make a new server and it throws, the error is caught and wrapped into a generic Boom.internal(), with no feedback on the original error or the stack trace. The only way to introspect is to pass routes.ext.onPreResponse.method() to server options.
This is a bit awkward, especially if I'm using the server for non-production cases, tests, or non-critical apps. It would be nice if the option to obfuscate errors was an opt-in / out configuration. I do understand that Hapi is this way in order to be secure by default, I just think it would be helpful
Do you have a new or modified API suggestion to solve the problem?
Perhaps a Hapi.server({ production: true | false }) would suffice? I am currently using NODE_ENV to set the onPreResponse options so I have good feedback at dev time.
- 主要语言
- JavaScript
- 星标
- 14.8k
- 派生
- 1.4k
- 平均合并
- 12 分钟
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hapijs/hapi 的其他 Issue
-
The data property of a Boom error gets mangled when the error comes from a validator可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 3/5 1-2 天 新手友好度 70/100
-
The `abort` event on nodejs is deprecated可能重新可做 @akashbirajdar04 于 192 天前认领,目前没有进行中的 PR。 未关闭bug
难度 3/5 1-2 天 新手友好度 52/100
-
Error-tracking software doesn't catch hapi application errors if an incoming request gets prematurely closed可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 5/5 一周以上 新手友好度 35/100
-
bug
难度 4/5 3-5 天 新手友好度 35/100
-
bug
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
ImranR98/apps.obtainium.imranr.dev#2000 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
-
难度 2/5 1-3 小时 新手友好度 83/100
microsoft/monaco-editor#5577 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
obsidianmd/obsidian-help#1169 ·
维护者通常 2 天内回复
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish step可能已有人在做 @albertteoh 今天认领。 未关闭documentation
难度 2/5 1-3 小时 新手友好度 85/100
jaegertracing/jaeger-ui#4739 ·
维护者通常 1 天内回复