Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

error-handling

/error-handling

Prowadzi przez obsługę błędów w React Native: granice błędów, interfejs awarii API, przepływy ponawiania i globalne handlery, by nie dopuścić do cichych awarii.

Licencja
MIT
Ostatnia zmiana repozytorium
29.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 29.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Prowadzi przez obsługę błędów w React Native: granice błędów, interfejs awarii API, przepływy ponawiania i globalne handlery, by nie dopuścić do cichych awarii.

Oryginalny opis (EN)

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.

Jak działa

  1. Applicability
  2. When to Use
  3. Severity
  4. Guidance
  5. Anti-Patterns
  6. Pitfalls
Sekcje z nagłówków SKILL.md, w oryginale · 76 linii, 502 słów
Podgląd SKILL.md
---
name: error-handling
description: 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.
version: 1.1.0
platforms: [ios, android]
react-native-version: 0.76+
tags: [react-native, errors, recovery]
---

# 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](../observability/SKILL.md). Crash rules that apply to every render belong to [critical-rules](../critical-rules/SKILL.md).

## 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:**
```tsx
export default function App() {
  return <Navigator />;
}
```

**Correct:**
```tsx
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](../state-and-data/SKILL.md).

- [ ] 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](../state-and-data/SKILL.md)
- [ ] 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.

Wersje

RepozytoriumWynikLicencja
Ta strona · neha/rn-developer-skills100MIT
ericrisco/rsc-harness100MIT
jcdendrite/claude-config100MIT
Sanit-mann/The-Insectoids100MIT
Esposter/Esposter100Apache-2.0
komluk/scaffolding100MIT
oborchers/fractional-cto100MIT
affaan-m/ECC100MIT
claude-dev-suite/claude-dev-suite100MIT

Migawka bazy z 13.11.2026 · wersja paczki ae1ea073e059 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90error-boundary-creator
    Tworzy granice błędów, obsługę błędów i widoki zastępcze w aplikacjach React oraz konfiguruje raportowanie błędów.
  • 90silent-failures
    Sprawdza obsługę błędów w lokalnych zmianach kodu pod kątem cichych awarii, nieodpowiednich zapasowych ścieżek i połkniętych wyjątków.
  • 90grill-error-handling
    Analizuje obsługę błędów, logowanie, obserwowalność i zarządzanie konfiguracją w bazie kodu, szukając cichych awarii.
  • 100error-audit
    Przegląda kod pod kątem brakującej obsługi błędów, połykanych wyjątków i cichych awarii, z listą poprawek.
  • 90frontend-error-handling
    Wdraża obsługę błędów w interfejsie: granice błędów, awaryjny widok, łagodne ograniczanie funkcji i raportowanie do monitoringu.
  • 90TanStack Errors
    Doradza w obsłudze błędów w TanStack Query: error boundaries z useQuery, throwOnError, globalne callbacki onError, stan błędu zapytań i obsługę błędów mutacji.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.