Add some error checking for read_io.
Merge pull request #8 from jelmer/error-checking

Add some error checking for read_io.