openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 927 B
JavaScript
import{jt as e}from"./disk-budget.worker-subsystem-9qP7ka6r.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}const t=Promise;function createDeferredCore(){return t.withResolvers()}export{throwSettledAggregate as a,throwIfSettledRejected as i,collectSynchronousErrors as n,materializeErrorStack as r,createDeferredCore as t};