Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 511 Bytes

no-unhandled-errors.md

File metadata and controls

25 lines (19 loc) · 511 Bytes

Ensures error handling on sagas

This rule ensures that all redux-saga effects are inside a try/catch block for error handling.

An uncaught error can cause all other sagas waiting to complete to be inadvertedly canceled.

import { call } from "redux-saga"

// good
function* good() {
  try {
    yield call(action)
  } catch (error) {
    yield call(handleError, error)
  }
}

// bad
function* bad() {
  call(action)
}