def invalid_url_error(url, action):
 if url.isValid():
  raise ValueError('Calling invalid_url_error with valid URL {}'.format(url.toDisplayString()))
 errstring = get_errstring(url, 'Trying to {} with invalid URL'.format(action))
 message.error(errstring)

def invalid_url_error ( url , action ) : if url . isValid ( ) : raise ValueError ( 'Calling invalid_url_error with valid URL {}' . format ( url . toDisplayString ( ) ) ) errstring = get_errstring ( url , 'Trying to {} with invalid URL' . format ( action ) ) message . error ( errstring )
display an error message for a url .