Throw an error when a file cannot be opened

Change-Id: I6d7a5254e1ed067e508498312d1e61795e66f9d9