buncargo 3.2.0 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,10 +124,9 @@ export async function startPublicTunnels(
124
124
  } = {},
125
125
  ): Promise<PublicTunnel[]> {
126
126
  const start = options.start ?? ((input) => startQuickTunnel(input));
127
- const tunnels: PublicTunnel[] = [];
128
127
 
129
- try {
130
- for (const target of targets) {
128
+ const settled = await Promise.allSettled(
129
+ targets.map(async (target) => {
131
130
  const localUrl = `http://localhost:${target.port}`;
132
131
  const tunnel = (await start({
133
132
  url: localUrl,
@@ -143,19 +142,32 @@ export async function startPublicTunnels(
143
142
  `Tunnel for "${target.name}" did not provide a public URL`,
144
143
  );
145
144
  }
146
- tunnels.push({
145
+ return {
147
146
  kind: target.kind,
148
147
  name: target.name,
149
148
  localUrl,
150
149
  publicUrl,
151
150
  close: toCloseFn(tunnel),
152
- });
151
+ };
152
+ }),
153
+ );
154
+
155
+ const tunnels: PublicTunnel[] = [];
156
+ const errors: unknown[] = [];
157
+ for (const result of settled) {
158
+ if (result.status === "fulfilled") {
159
+ tunnels.push(result.value);
160
+ } else {
161
+ errors.push(result.reason);
153
162
  }
154
- return tunnels;
155
- } catch (error) {
163
+ }
164
+
165
+ if (errors.length > 0) {
156
166
  await stopPublicTunnels(tunnels);
157
- throw error;
167
+ throw errors[0];
158
168
  }
169
+
170
+ return tunnels;
159
171
  }
160
172
 
161
173
  export async function stopPublicTunnels(