Post

Propagating Fixture Search Errors in the Prowlarr Config Check

Propagating Fixture Search Errors in the Prowlarr Config Check

The Prowlarr configuration check masked fixture-search failures by wrapping grep in || true. This commit moves the fallback outside the command substitution so a non-zero grep exit causes the shell function to return early instead of silently continuing with empty counts. The script now fails explicitly when it cannot inspect the fixture, rather than passing an empty result as if the check had run.

Command substitution versus shell function return

Previously both total and matches used grep ... || true inside $(...). When grep found nothing it exited non-zero, but || true converted that to success, so the assignment completed and the function kept running with empty string values. The new form runs grep ... inside the substitution and attaches || return to the assignment itself. If grep fails, the assignment exits non-zero and the function returns immediately, surfacing the search failure instead of comparing against nothing.

Why silent empty counts are dangerous

A missing or unreadable fixture previously produced empty total and matches strings, which could pass equality comparisons that were meant to validate actual content. Early return turns a hidden data problem into a hard stop, so CI does not report success from an absence of evidence. I have not run this script after the change; the patch itself only alters how failures propagate, not what success looks like.

Shell error handling as a reusable pattern

This is a small but portable technique: keep side effects inside command substitution, but let the outer expression decide what to do when the inner command fails. A platform team can apply the same split anywhere a shell wrapper captures tool output and then validates it, ensuring a broken lookup fails the pipeline instead of producing a false empty count.

This post is licensed under CC BY 4.0 by the author.