def _get_query_handle_and_state(query_history):
 handle = query_history.get_handle()
 if (handle is None):
  raise PopupException(_('Failed to retrieve query state from the Query Server.'))
 state = dbms.get(query_history.owner, query_history.get_query_server_config()).get_state(handle)
 if (state is None):
  raise PopupException(_('Failed to contact Server to check query status.'))
 return (handle, state)

def _get_query_handle_and_state ( query_history ) : handle = query_history . get_handle ( ) if ( handle is None ) : raise PopupException ( _ ( 'Failed to retrieve query state from the Query Server.' ) ) state = dbms . get ( query_history . owner , query_history . get_query_server_config ( ) ) . get_state ( handle ) if ( state is None ) : raise PopupException ( _ ( 'Failed to contact Server to check query status.' ) ) return ( handle , state )
front-end wrapper to handle exceptions .