---
title: "Discussion on \"DataWeave match/case: Replace If/Else Chains and Avoid the Missing Else Crash\" | Hashnode"
description: "Discussion on \"DataWeave match/case: Replace If/Else Chains and Avoid the Missing Else Crash\". I replaced a 40-line if/else chain with 4 match/case lines last month. Then I forgot the else clause and 3,000 production events backed up.\nTL;DR\n\nmatch/case replaces nested if/else with value matching, guard conditions, and type dispatch\nMissing els..."
url: "https://hashnode.com/posts/dataweave-matchcase-replace-ifelse-chains-and-avoid-the-missing-else-crash/69d27ad50ea8840088b46d8a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [DataWeave match/case: Replace If/Else Chains and Avoid the Missing Else Crash](https://thasha.hashnode.dev/dataweave-matchcase-replace-ifelse-chains-and-avoid-the-missing-else-crash?utm_source=hashnode&utm_medium=feed)

I replaced a 40-line if/else chain with 4 match/case lines last month. Then I forgot the else clause and 3,000 production events backed up. TL;DR match/case replaces nested if/else with value matching, guard conditions, and type dispatch Missing els...

Apr 5 · 3 min read · thasha.hashnode.dev  
Read the article

## Written by

[ThaSha](https://hashnode.com/@thasha)

@thasha

  
[View profile](https://hashnode.com/@thasha)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
