<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw" -->

---
title: My Harness Used One Label for Three Different Failures.
description: A postmortem walks through a bug where a single catch block collapsed three distinct failure causes—unreadable arguments, a genuine mismatch, and a comparator...
canonical: https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: My Harness Used One Label for Three Different Failures. | daily.dev
og:description: A postmortem walks through a bug where a single catch block collapsed three distinct failure causes—unreadable arguments, a genuine mismatch, and a comparator...
og:url: https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw
og:image: https://api.daily.dev/og/posts/5bfYdrbZw.png
og:image:alt: My Harness Used One Label for Three Different Failures.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# My Harness Used One Label for Three Different Failures.

**[DEV](https://daily.dev/sources/devto)** · 10 min read · 1 upvotes · 0 comments

## Summary

A postmortem walks through a bug where a single catch block collapsed three distinct failure causes—unreadable arguments, a genuine mismatch, and a comparator crash—into one misleading label, EXEC_ARGUMENTS_MISMATCH. The fix splits the try/catch into separate stages with distinct error names (EXEC_ARGUMENTS_INVALID, EXEC_ARGUMENTS_MISMATCH, EXEC_COMPARATOR_ERROR), backed by an ablation test suite proving the change. The piece also surfaces two deeper defects found along the way: two inconsistent failure-reason whitelists (one silently drops unknown codes, the other throws), and two of the author's own mistaken conclusions caught by commenters. Reader comments push further, pointing out the new EXEC_COMPARATOR_ERROR label still conflates a bad fixture with a genuine comparator bug, prompting a follow-up discussion about hoisting canonicalization earlier.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/kenielzep97/my-harness-used-one-label-for-three-different-failures-2gc3>

## Questions this post answers

### How do I fix a try/catch block that reports different failure causes under the same error label?

Split the single try/catch into separate stages, each with its own catch and its own distinct error name. In one case, wrapping both JSON parsing and byte comparison in one try/catch meant both an unreadable argument and a failed comparison threw the same EXEC_ARGUMENTS_MISMATCH label; separating parse from compare let each stage emit EXEC_ARGUMENTS_INVALID, EXEC_ARGUMENTS_MISMATCH, or EXEC_COMPARATOR_ERROR depending on which step actually failed.

_daily.dev surfaces engineering writeups like this for teams untangling ambiguous error labels in their own test harnesses._

### Why would a filter that silently drops unrecognized failure codes be worse than one that throws on them?

A silent filter is designed to fail invisibly: adding a new failure reason to the code without registering it in the filtering whitelist makes that failure vanish from output with no indication anything is wrong, whereas a registry that throws a TypeError on an unknown reason surfaces the gap immediately. In one system, the broader 26-code list filtered silently while the narrower 20-code subset correctly threw, which is backwards from what you'd want.

_engineers designing failure-reason registries can compare tradeoffs like this via daily.dev before picking silent-drop versus throw-on-unknown behavior._

### Why can a test I write against my own implementation's output fail to catch a bug in that implementation?

An assertion derived from the implementation's actual output rather than from an independent expectation can never fail, because it was built to match whatever the code already does, bugs included. This exact workflow let a backwards error-collapse fix pass its own test suite, since the test was written after the implementation and simply asserted the code's existing (wrong) behavior.

_daily.dev helps developers spot testing anti-patterns like this before they ship a self-confirming test suite._

## Similar posts on daily.dev

- [Compare Against the Schema They Shipped, Not the One You Expected](https://daily.dev/posts/compare-against-the-schema-they-shipped-not-the-one-you-expected-soyixexay) · DEV · 3 upvotes · 2 comments
- [Bug Detection Blind Spots in AI Coding Harnesses \(GStack and Beyond\)](https://daily.dev/posts/bug-detection-blind-spots-in-ai-coding-harnesses-gstack-and-beyond--5k8lonjtf) · Towards Data Science · 0 upvotes · 0 comments
- [The two kinds of error](https://daily.dev/posts/the-two-kinds-of-error-zsfcltzzr) · Lobsters · 0 upvotes · 0 comments
- [Did My Test Suite Just Kill the GitHub Actions Runner\!?](https://daily.dev/posts/did-my-test-suite-just-kill-the-github-actions-runner--socinxsca) · ITNEXT · 2 upvotes · 0 comments
- [I said your ELT benchmark was probably lying. Then mine lied to me — three times.](https://daily.dev/posts/i-said-your-elt-benchmark-was-probably-lying-then-mine-lied-to-me-three-times--ikymjzrrd) · Medium · 0 upvotes · 0 comments

---

Tags: [#ai](https://daily.dev/tags/ai), [#javascript](https://daily.dev/tags/javascript), [#open-source](https://daily.dev/tags/open-source), [#testing](https://daily.dev/tags/testing)

[View this post on daily.dev](https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"My Harness Used One Label for Three Different Failures.","url":"https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw"},"datePublished":"2026-09-14T20:17:47.056Z","dateModified":"2026-09-14T21:05:31.842Z","description":"A postmortem walks through a bug where a single catch block collapsed three distinct failure causes—unreadable arguments, a genuine mismatch, and a comparator...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/10198a48118881e20a65ad074ab5adf2?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/10198a48118881e20a65ad074ab5adf2?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DEV","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DEV","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/devto","url":"https://daily.dev/sources/devto"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai,javascript,open-source,testing","timeRequired":"PT10M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DEV","item":"https://daily.dev/sources/devto"},{"@type":"ListItem","position":3,"name":"My Harness Used One Label for Three Different Failures."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/my-harness-used-one-label-for-three-different-failures--5bfydrbzw#faq","mainEntity":[{"@type":"Question","name":"How do I fix a try/catch block that reports different failure causes under the same error label?","acceptedAnswer":{"@type":"Answer","text":"Split the single try/catch into separate stages, each with its own catch and its own distinct error name. In one case, wrapping both JSON parsing and byte comparison in one try/catch meant both an unreadable argument and a failed comparison threw the same EXEC_ARGUMENTS_MISMATCH label; separating parse from compare let each stage emit EXEC_ARGUMENTS_INVALID, EXEC_ARGUMENTS_MISMATCH, or EXEC_COMPARATOR_ERROR depending on which step actually failed. daily.dev surfaces engineering writeups like this for teams untangling ambiguous error labels in their own test harnesses."}},{"@type":"Question","name":"Why would a filter that silently drops unrecognized failure codes be worse than one that throws on them?","acceptedAnswer":{"@type":"Answer","text":"A silent filter is designed to fail invisibly: adding a new failure reason to the code without registering it in the filtering whitelist makes that failure vanish from output with no indication anything is wrong, whereas a registry that throws a TypeError on an unknown reason surfaces the gap immediately. In one system, the broader 26-code list filtered silently while the narrower 20-code subset correctly threw, which is backwards from what you'd want. engineers designing failure-reason registries can compare tradeoffs like this via daily.dev before picking silent-drop versus throw-on-unknown behavior."}},{"@type":"Question","name":"Why can a test I write against my own implementation's output fail to catch a bug in that implementation?","acceptedAnswer":{"@type":"Answer","text":"An assertion derived from the implementation's actual output rather than from an independent expectation can never fail, because it was built to match whatever the code already does, bugs included. This exact workflow let a backwards error-collapse fix pass its own test suite, since the test was written after the implementation and simply asserted the code's existing (wrong) behavior. daily.dev helps developers spot testing anti-patterns like this before they ship a self-confirming test suite."}}]}
```

