Throw an error if the file id is not found.

The read function now throws an error if the requested file does not exist.