Handle exceptions in reading from binaries