Index of every page on this site: llms.txt
All skills
neha avatar

/error-handling

@eb9f097
Run it yourself

Guide error boundaries, API failure UI, retry flows, and global handlers in React Native. Use when adding error recovery, reviewing failure states, or preventing silent failures.

Use this Skill: https://skilld.dev/gh/neha/rn-developer-skills/error-handling

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈49 tokens for metadata: the name and description. ≈740 when used: this file.

Description uses 2.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈195 characters, or 2.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Error Handling Skill

Applicability

  • Platforms: iOS and Android
  • React Native: 0.76+ (New Architecture interop assumed unless a checklist item says otherwise)

When to Use

  • Adding an error boundary or a fallback when a feature fails
  • Designing what the user sees when an API call, mutation, or native call fails
  • Adding retry, or deciding that a request must not be retried
  • Reviewing a screen that can fail and currently only handles the happy path

Reporting the failure to a crash or analytics tool belongs to observability. Crash rules that apply to every render belong to critical-rules.

Severity

  • Merge-blocking: a feature this diff adds can throw during render and take the app down with it, or a submit this diff adds swallows the error.
  • Should-fix: error copy and retry wording.

Guidance

Isolation

  • An error boundary wraps the app root and each feature that can fail on its own
  • The fallback UI renders without network calls or the state that just threw
  • A feature failure disables or replaces that feature and leaves the rest of the app usable
  • Errors in event handlers and async work are caught where they happen (a boundary does not catch them)

Incorrect:

export default function App() {
  return <Navigator />;
}

Correct:

export default function App() {
  return (
    <ErrorBoundary fallback={<AppCrashScreen />}>
      <Navigator />
    </ErrorBoundary>
  );
}

What the user sees

Loading, empty, and error states for server data are owned by state-and-data.

  • The error copy says what happened and what to do next, not the raw server or native message
  • A caught error the user can retry is not also shown as a full-screen crash

Retry

  • Retry is an explicit button or a single bounded attempt, not an unbounded loop
  • Retrying a POST when the network returns is owned by state-and-data
  • A retry uses the same idempotency key as the original attempt when the server supports one

Anti-Patterns

Anti-Pattern Risk Fix
Empty catch The user sees a spinner or a success state for a failed action Surface an error state and log a non-sensitive reason
Fallback that fetches data The fallback throws and replaces itself Static fallback with a retry action
Alert for every failed background refresh Interrupts the user for a failure they did not start Inline error on the screen that owns the data

Pitfalls

  • Error boundaries catch render errors. They do not catch onPress handlers, timers, or rejected promises.
  • A global unhandled-rejection handler is a backstop for reporting. It is not a substitute for an error state on the screen that started the work.
  • Resetting the boundary on every render remounts the broken tree and can loop.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill provides architectural guidelines and best practices for error handling in React Native applications. It contains no executable code or security risks.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at eb9f097. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 2 months ago
version
1.1.0
platforms
[
  "ios",
  "android"
]
react-native-version
0.76+
Other metadata
tags
[
  "react-native",
  "errors",
  "recovery"
]

README badge

README badge for neha/rn-developer-skills/error-handling