def _ToSearchError(error):
 if (error.application_error in _ERROR_MAP):
  return _ERROR_MAP[error.application_error](error.error_detail)
 return error

def _ToSearchError ( error ) : if ( error . application_error in _ERROR_MAP ) : return _ERROR_MAP [ error . application_error ] ( error . error_detail ) return error
translate an application error to a search error .