state and error for reader