Skip to content

Return an error from Core.Case when no exit matches and there is no default exit - #346

Merged
joaothallis merged 3 commits into
developfrom
fix/case-block-no-default-exit
Sep 30, 2026
Merged

joaothallis merged 3 commits into
developfrom
fix/case-block-no-default-exit

Conversation

@joaothallis

@joaothallis joaothallis commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

A Core.Case block whose exit tests all evaluate to false and which has no default exit crashes the calling process with a MatchError, because Case.evaluate_outgoing/5 bang-matches Block.evaluate_exits/2. #258 made that situation a graceful {:error, "No default exit available"} everywhere except this path. The error now returns through Block.evaluate_outgoing/5 so callers can end the flow cleanly.

@joaothallis joaothallis self-assigned this Sep 10, 2026
… no default exit

FlowRunner.Spec.Blocks.Case.evaluate_outgoing/5 bang-matched
Block.evaluate_exits/2, so the {:error, "No default exit available"} that
#258 introduced as a graceful return raised a MatchError in the caller's
process instead. The error now returns through Block.evaluate_outgoing/5,
which already propagates the same error from fetch_next_block/3.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@joaothallis
joaothallis force-pushed the fix/case-block-no-default-exit branch from 69066c7 to 1adfaf1 Compare September 11, 2026 02:18
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@joaothallis
joaothallis marked this pull request as ready for review September 14, 2026 13:38
santiagocardo
santiagocardo previously approved these changes Sep 30, 2026

@santiagocardo santiagocardo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joaothallis 🙌

Comment thread mix.exs
use Mix.Project

@version "6.15.1"
@version "6.15.2"

@santiagocardo santiagocardo Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd also need to update README.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 00c8890

@joaothallis
joaothallis merged commit 9499bfe into develop Sep 30, 2026
2 checks passed
@joaothallis
joaothallis deleted the fix/case-block-no-default-exit branch September 30, 2026 21:27
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants