Temporarily use an error handler when reading from stream