AIPM
Theme

AIPM package

Handling Failures

@riekelt/handling-failures@1.0.0

Catch block, fallback, default value, retry, or degraded mode - in any language, any repo.

Scanned · no issues · Nov 28, 2026

GitHub stars: ★ 6

LinkedInPost

Install Skill

Pins this version in aipm.package.json and aipm-lock.json.

aipm add @riekelt/handling-failures@1.0.0

Without project tracking

Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.

aipm add @riekelt/handling-failures@1.0.0 --no-init

How to use

Install the skill above, then run this in your AI tool:

/handling-failures <your description>

About

**REQUIRED BACKGROUND:** the `principal-engineering` skill.

Source

What gets added to your project

Preview every file this package writes on install before you run the command above.

Summary

Use when writing or touching any error path, catch block, fallback, default value, retry, or degraded mode - in any language, any repo. Encodes the no-silent-swallows contract and the fail-loud discipline.

Skill instructions

Handling failures

REQUIRED BACKGROUND: the principal-engineering skill.

Overview

A swallowed error is a bug with its evidence destroyed. Core contract: every failure path does exactly one of three things, and all three are loud. A system that looks healthy while serving wrong data is worse than one that crashes.

The contract

Every catch and failure path either:

  1. Logs at WARN or ERROR and rethrows, or
  2. Logs and returns a TYPED failure the caller must handle (a result type, a sealed error, a status the compiler or contract forces downstream code to acknowledge), or
  3. Logs and enters an explicitly documented degraded mode (named in the code and its documentation, with something observable saying the system is degraded).

Forbidden, no exceptions:

  • Bare catch-and-continue.
  • Catch-and-return-default (empty list, null, zero, cached copy) that masks the failure.
  • ?? fallback and its cousins where the fallback hides that the primary failed. A fallback is acceptable only when the absence is ALSO surfaced loudly elsewhere.

Corollaries

  • A missing required entry fails loud. Something absent from a registry, config, or catalog is a build or startup failure, never a silent default.
  • Error states are visible. A workflow must not appear healthy while failing; surface the error state in the UI, the metrics, or the logs someone actually watches.
  • Operator-facing remediation is specific. "connection failed, check REDIS_URL and whether redis responds to PING" beats "an error occurred".
  • Retries are bounded and observable.
  • Replays of side-effecting operations are idempotent.
  • Degraded modes have a bound. Skip-and-continue needs the explicit threshold where degradation becomes abort, as a named, operator-tunable constant. The guard must exist; its value is a judgment call to make with the owner. An unbounded degraded mode is a slow-motion swallow.
  • On failure paths, observability is part of the minimum, not gold-plating. The log line, the counter, and the alert ship with the fix; a failure path without them is the silent swallow with better intentions.

Touching existing swallows

Code you are editing that already swallows: fix it as part of the work, or explicitly flag it as owed with what it hides. Leaving it silently is endorsing it. In review, a NEW silent swallow is an automatic BLOCKER; a pre-existing one you touched and left unflagged is a WARNING against the change.

Common mistakes

  • "It should never happen" as a reason to swallow. Those paths are exactly the ones that need a loud alarm when they do.
  • Logging at DEBUG and calling it handled. If nobody sees it in production, it is a swallow with extra steps.
  • Catching broad (Exception, catch {}) to handle narrow. The unexpected failure dies silently beside the expected one.
  • A degraded mode nobody documented. Degradation only the author knows about is an outage the operator cannot diagnose.
  • Making the test pass by defaulting the failure. The test goes green; the defect graduates to production.

Loading package files…

Share this package

Add an Install with AIPM badge

Add this badge to a GitHub README so readers can open the package page and install the same version.

Install with AIPM
[![Install with AIPM](https://www.aipm-registry.com/install-with-aipm.svg)](https://www.aipm-registry.com/skills/riekelt/handling-failures/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)

Publisher

riekelt

This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.

AI assistant context

What this skill is for

@riekelt/handling-failures@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Use when writing or touching any error path, catch block, fallback, default value, retry, or degraded mode - in any language, any repo. Encodes the no-silent-swallows contract and the fail-loud discipline. Use whenever an exception is ab...

Install
aipm add @riekelt/handling-failures@1.0.0
Use after install
/handling-failures <your description>

Tool targets

Install command by target

Add --no-init to any of these when you want the skill files without aipm.package.json or aipm-lock.json.

cursor

Run this variant when you want to install the package into cursor.

aipm add @riekelt/handling-failures@1.0.0 --target cursor --ci

claude

Run this variant when you want to install the package into claude.

aipm add @riekelt/handling-failures@1.0.0 --target claude --ci

Discussion

Comments (0)

Loading comments…

Keep exploring

riekelt/keeping-one-source-of-truth

Use when adding data, config, state, constants, an enum-like string, a cache, or anything that could exist in two places - or when two sources already disagree. Encodes the one-fact-one-source doctrine for code and data: derive rather th...

Published by @riekelt

skillScanned · no issues★ 6Imported · UnverifiedAll toolsNov 28, 2026, 1:03 AM1.92 KBApache-2.0

riekelt/grounding-before-coding

Use when starting any non-trivial change, investigating a bug, or working in unfamiliar code - before the first line is written. Also use for pure investigation with no change planned yet - \"dig into this\", \"figure out why\", \"someti...

Published by @riekelt

skillScanned · no issues★ 6Imported · UnverifiedAll toolsNov 28, 2026, 1:03 AM2.07 KBApache-2.0

riekelt/verifying-before-done

Use when about to say \"done\", \"fixed\", \"passing\", or \"shipped\", or when reporting the outcome of any change. Encodes verification as the definition of done: drive the change at its surface, run the verify command, report faithful...

Published by @riekelt

skillScanned · no issues★ 6Imported · UnverifiedAll toolsNov 28, 2026, 1:03 AM3.06 KBApache-2.0

Package FAQ

Install and compatibility

How to install
Run aipm add @riekelt/handling-failures@1.0.0 in a project that has AIPM initialized.
Supported tools
@riekelt/handling-failures@1.0.0 supports All tools.

Before installing

AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.