Yeah, because checking return codes and error values is overrated
Even Google's own non-AOSP camera is guilty of this too.
The API docs says an app should check for camera capabilities before using them. Still the PhotoSphere feature in Google's non-AOSP camera attempts to set Flash-settings on devices with no flash-capability.
To overcome the issue you have to rewrite the camera-interface code to ignore API calls to SetFlash, SetLightmode etc when not supported, instead of throwing as you should be doing according to the docs.
Google is one of the worse offenders when it comes to not following android guidelines. Their apps consistently break back button behavior, don't follow UI guidelines, etc.
Thanks Google, for making my phone less secure.