Throw exception on error from command