Test case for errorHandler with state.