Throw an error when a file cannot be opened

Change-Id: I6d7a5254e1ed067e508498312d1e61795e66f9d9
Merge remote-tracking branch 'origin/master' into HEAD

Change-Id: I759409bd40f8377e1d2fd5ce0b16ece6dd0bb764