Browse Source

fix: catch error for executing code online

master
smallstonesk 4 years ago
parent
commit
43d7542365
  1. 5
      packages/compile-code/src/template/runOnline.ts

5
packages/compile-code/src/template/runOnline.ts

@ -60,7 +60,10 @@ const makeCode = (mockNode: any, mockInput: any) => `
const context = ctx.getContext();
window.dispatchEvent(new CustomEvent('iMoveOnlineExecEnds', {detail: {pipe, context}}));
});
})();
})().catch(err => {
console.error(err.message);
window.dispatchEvent(new CustomEvent('iMoveOnlineExecEnds', {detail: {error: {message: err.message}}}));
});
`;
export default makeCode;

Loading…
Cancel
Save