Make error message more generic.

Change-Id: If8bb5a4fcb11112cb757dc3dbddbdab42a9a9eb0
Use generic ResourceFailure exception instead of custom exceptions.

Change-Id: I0b4e4c165cf1fd9b695cbb202de7895a8bade05e