Skip to content

Commit 13c8f00

Browse files
committed
Restart even if callback throws
1 parent 5f39add commit 13c8f00

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

dev-packages/rollup-utils/npmHelpers.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function makeBaseNPMConfig(options = {}) {
9393
}
9494

9595
return true;
96-
}
96+
},
9797
},
9898

9999
plugins: [nodeResolvePlugin, sucrasePlugin, debugBuildStatementReplacePlugin, rrwebBuildPlugin, cleanupPlugin],

packages/node-native/src/event-loop-block-integration.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,18 @@ export function disableBlockDetectionForCallback<T>(callback: () => T | Promise<
229229

230230
integration.stop();
231231

232-
const result = callback();
233-
if (isPromise(result)) {
234-
return result.finally(() => integration.start());
232+
try {
233+
const result = callback();
234+
if (isPromise(result)) {
235+
return result.finally(() => integration.start());
236+
}
237+
238+
integration.start();
239+
return result;
240+
} catch (error) {
241+
integration.start();
242+
throw error;
235243
}
236-
237-
integration.start();
238-
return result;
239244
}
240245

241246
/**

0 commit comments

Comments
 (0)