diff --git a/src/runtime/internal/await_block.ts b/src/runtime/internal/await_block.ts index 3821520837..4b7ca6fd21 100644 --- a/src/runtime/internal/await_block.ts +++ b/src/runtime/internal/await_block.ts @@ -59,12 +59,12 @@ export function handle_promise(promise, info) { update(info.then, 1, info.value, value); set_current_component(null); }, error => { - if (!info.hasCatch) { - throw error; - } set_current_component(current_component); update(info.catch, 2, info.error, error); set_current_component(null); + if (!info.hasCatch) { + throw error; + } }); // if we previously had a then/catch block, destroy it diff --git a/test/runtime/samples/await-without-catch/_config.js b/test/runtime/samples/await-without-catch/_config.js index 2030ed7949..1b7da5c0be 100644 --- a/test/runtime/samples/await-without-catch/_config.js +++ b/test/runtime/samples/await-without-catch/_config.js @@ -39,6 +39,7 @@ export default { }) .catch((err) => { assert.equal(err.message, 'this error should be thrown'); + assert.htmlEqual(target.innerHTML, ''); }); } }; \ No newline at end of file