Fix exception throwing logic.

My previous pull request was using throw without arguments, which is used only for re-throwing, and since there was nothing to rethrow, terminate() was being called. Now a proper exception is thrown.

This reminds me that there should be more complete unit tests in place. I've started to write some for hardware_interface, but they're not complete yet. I'll try to get them to a decent state and submit a pull request.