UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

1 lines 585 B
import{isObject}from"#shared/guards.js";import{walkCauseChain}from"#shared/errors.js";function extractErrorSignals(t){let n=[];for(let r of walkCauseChain(t)){if(!isObject(r))continue;let e={message:typeof r.message==`string`?r.message:``};typeof r.name==`string`&&r.name.length>0&&(e.name=r.name),typeof r.code==`string`&&r.code.length>0&&(e.code=r.code),typeof r.statusCode==`number`&&(e.statusCode=r.statusCode),typeof r.type==`string`&&r.type.length>0&&(e.type=r.type),typeof r.hint==`string`&&r.hint.length>0&&(e.hint=r.hint),n.push(e)}return{chain:n}}export{extractErrorSignals};