openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 833 B
JavaScript
import{En as e}from"./openclaw-state-read-subsystem-Dwoo5bcz.mjs";function throwIfSettledRejected(e,t){throwCollectedErrors(e.flatMap(e=>e.status===`rejected`?[e.reason]:[]),t)}function throwSettledAggregate(e,t){let n=e.flatMap(e=>e.status===`rejected`?[e.reason]:[]);if(n.length)throw AggregateError(n,t)}function throwCollectedErrors(e,t){if(e.length===1)throw e[0];if(e.length>1)throw AggregateError(e,t)}function materializeErrorStack(t){try{for(let n of e(t))try{if(!(n instanceof Error))continue;try{n.stack=String(n.stack)}catch{n.stack=`Stack trace unavailable: custom formatter failed`}}catch{}}catch{}}function collectSynchronousErrors(e,t){let n=[];for(let r of e)try{t(r)}catch(e){n.push(e)}return n}export{throwSettledAggregate as i,materializeErrorStack as n,throwIfSettledRejected as r,collectSynchronousErrors as t};