Skip to content

🐛 Catch errors in effect.enter() - #1179

Merged
cowboyd merged 1 commit into
v4from
catch-errors-in-action-enter
Jun 5, 2026
Merged

🐛 Catch errors in effect.enter()#1179
cowboyd merged 1 commit into
v4from
catch-errors-in-action-enter

Conversation

@cowboyd

Copy link
Copy Markdown
Member

Motivation

If there is a straightup error that happens synchronously inside an effect's executor, it will actually be caught inside the reducer and crash the entire co-routine. But instead, it should just raise an error inside the current yield point.

Approach

This catches any exception that happens synchronously while entering an action and then resumes the coroutine with it.

closes#1178

If there is a straightup error that happens synchronously inside an
effect's executor, it will actually be caught inside the reducer and
crash the entire co-routine. But instead, it should just raise an
error inside the current yield point.
This catches any exception that happens synchronously while entering
an action and then resumes the coroutine with it.
@pkg-pr-new

pkg-pr-newBot commented Jun 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/effection@1179

commit: fdd169f

@cowboyd
cowboyd requested a review from tarasJune 5, 2026 16:09
@codspeed-hq

codspeed-hqBot commented Jun 5, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing catch-errors-in-action-enter (fdd169f) with v4 (d326678)

Open in CodSpeed

@cowboyd
cowboyd merged commit 18353aa into v4Jun 5, 2026
27 of 28 checks passed
@cowboyd
cowboyd deleted the catch-errors-in-action-enter branch June 5, 2026 18:19
@cowboydcowboyd mentioned this pull request Jul 8, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@cowboyd@jbolda