revert to exception on query for exit_code on incorrect state, for the time being...