Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

nodejs runtime missing `cause` when unhandled error thrown

未關閉
#178 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
nodejs, typescript
領域
backend

研究方向

從 index.js 中的重現開始,檢查會產生所示記錄物件的未處理例外路徑。使用儲存庫現有的執行階段測試(如果有),驗證最終的錯誤輸出包含 errorCause 欄位,且其值為 cause。

由索引模型根據 Issue 內容生成。

描述

For additional context see https://github.com/middyjs/middy/issues/994

index.js

export const handler = () => {}
throw new Error('error', {cause:'cause'})

logs

2023-01-26T07:46:54.151Z	undefined	ERROR	Uncaught Exception 	{
    "errorType": "Error",
    "errorMessage": "cold",
    "stack": [
        "Error: cold",
        "    at file:///var/task/index.mjs:86241:7",
        "    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)",
        "    at async Promise.all (index 0)",
        "    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)",
        "    at async _tryAwaitImport (file:///var/runtime/index.mjs:921:16)",
        "    at async _tryRequire (file:///var/runtime/index.mjs:970:86)",
        "    at async _loadUserApp (file:///var/runtime/index.mjs:994:16)",
        "    at async UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:1035:21)",
        "    at async start (file:///var/runtime/index.mjs:1200:23)",
        "    at async file:///var/runtime/index.mjs:1206:1"
    ]
}

Expect object to include"errorCause": "cause".

主要語言
TypeScript
星號
224
分支
60
平均合併
26 分鐘
30 天內合併 PR
2

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aws/aws-lambda-nodejs-runtime-interface-client 的其他 Issue

查看 aws/aws-lambda-nodejs-runtime-interface-client 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。