Display an error when there is missing keyword.

    :param sender: The sender.
    :type sender: object

    :param missing_keyword_exception: A KeywordNotFoundError exception.
    :type missing_keyword_exception: KeywordNotFoundError
512393
def missing_keyword_message(sender, missing_keyword_exception):
    
    warning_heading = m.Heading(
        tr('Missing Keyword'), **WARNING_STYLE)
    warning_message = tr(
        'There is missing keyword that needed for this analysis.')
    detail_heading = m.Heading(
        tr('Detail'), **DETAILS_STYLE)
    suggestion_heading = m.Heading(
        tr('Suggestion'), **DETAILS_STYLE)
    detail = tr(
        'The layer <b>%s</b> is missing the keyword <i>%s</i>.' % (
            missing_keyword_exception.layer_name,
            missing_keyword_exception.keyword
        )
    )
    suggestion = m.Paragraph(
        tr('Please use the keyword wizard to update the keywords. You '
           'can open the wizard by clicking on the '),
        m.Image(
            'file:///%s/img/icons/'
            'show-keyword-wizard.svg' % resources_path(),
            **SMALL_ICON_STYLE),
        tr(' icon in the toolbar.')
    )

    message = m.Message()
    message.add(warning_heading)
    message.add(warning_message)
    message.add(detail_heading)
    message.add(detail)
    message.add(suggestion_heading)
    message.add(suggestion)
    send_static_message(sender, message)
818270
def emailErrorMessage(subject,message):
    '''
    
    '''
    if not getConstant('email__enableErrorEmails'):
        logger.info('Not sending error email: error emails are not enabled.')
        return

    send_from = getConstant('email__errorEmailFrom')
    send_to = getConstant('email__errorEmailTo')

    if not send_from or not send_to:
        logger.error('Cannot send error emails because addresses have not been specified.')
        return

    try:
        send_mail(subject,message,
                  send_from,
                  [send_to], fail_silently=False)
        logger.debug('Error email sent.')
    except Exception as e:
        logger.error('Error email was not sent: %s' % e)
426632
def ErrorMsg():
    
    import traceback

    limit = None
    _type, value, tb = sys.exc_info()
    _list = traceback.format_tb(tb, limit) + \
        traceback.format_exception_only(_type, value)
    return "Traceback (innermost last):\n" + "%-20s %s" % (
        " ".join(_list[:-1]),
        _list[-1])
1089148
public static void sendError( String messageKey, Throwable cause, ServletRequest request,
                                  HttpServletResponse response, Object[] messageArgs )
            throws IOException
    {
        // TODO: the following null check will be unnecessary once the deprecated
        // FlowController.sendError(String, HttpServletResponse) is removed.
        boolean avoidDirectResponseOutput = request != null ? avoidDirectResponseOutput( request ) : false;
        sendError( messageKey, messageArgs, request, response, cause, avoidDirectResponseOutput );
    }
378385
def _catch_index_error(self, response):
        
        code, headers, raw_data = response
        if not raw_data:
            return
        data = json.loads(raw_data)
        if not data or not data.get('errors'):
            return
        try:
            error_dict = data['items'][0]['index']
            message = error_dict['error']
        except (KeyError, IndexError):
            return
        raise exception_response(400, detail=message)
279964
def respond_to_missing?(method, include_private = false)
      # Short circuit if we have invalid instance variable name,
      # otherwise we get an exception that we don't need.
      return super unless valid_instance_variable? method
      if instance_variable_defined? instance_variablize(method)
        true
      else
        super
      end
    end
505480
def error(response)
      if response.body && response.body.match("missing client token")
        raise MissingTokenError
      end

      # Use the correct exception class
      case response
      when Net::HTTPClientError
        klass = HTTPClientError
      when Net::HTTPServerError
        klass = HTTPServerError
      else
        klass = HTTPError
      end

      if (response.content_type || '').include?("json")
        # Attempt to parse the error as JSON
        begin
          json = JSON.parse(response.body, JSON_PARSE_OPTIONS)

          if json[:errors]
            raise klass.new(address, response, json[:errors])
          end
        rescue JSON::ParserError; end
      end

      raise klass.new(address, response, [response.body])
    end
949697
def _showError(self, msg="", title="Error"):
        
        self.errorWidget.setError(msg=msg, title=title)
84196
def note_error(exception, type, explanation = '')
      without_recording_messages do
        explanation = explanation.to_s.strip
        message = "Saw #{exception ? exception.message : 'error'} during #{type}"
        message += ": #{explanation}" unless explanation.empty?
        error(message)
      end
      @errors << [exception, type, explanation]
    end
19426
def show_crit_window_err_messege(self, crit):
        
        dlg = wx.MessageDialog(
            self, caption="Error:", message="not a vaild value for statistic %s\n ignoring value" % crit, style=wx.OK)
        result = self.show_dlg(dlg)
        if result == wx.ID_OK:
            dlg.Destroy()
1140504
def handle_context_missing(self):
        
        if self.context_missing == 'RUNTIME_ERROR':
            log.error(MISSING_SEGMENT_MSG)
            raise SegmentNotFoundException(MISSING_SEGMENT_MSG)
        else:
            log.error(MISSING_SEGMENT_MSG)
1027371
def show_error(cls, error=True):
        
        if error:
            cls.input_el.style.border = "2px solid red"
            cls.conspect_el.style.border = "2px solid red"
            cls.subconspect_el.style.border = "2px solid red"
        else:
            cls.input_el.style.border = "0"
            cls.conspect_el.style.border = "0"
            cls.subconspect_el.style.border = "0"
552366
def popError(text, title="Lackey Error"):
    
    root = tk.Tk()
    root.withdraw()
    tkMessageBox.showerror(title, text)
954471
def missing(self):
        
        if self.type == BOOLEAN:
            Log.error("programmer error")
        return self.lang[MissingOp(self)]
365033
def error(self, msg):
        ''''''
        if self.finished():
            raise ConfigParseError("Unexpected end of input; %s" % (msg,))
        else:
            t = self.peek()
            raise ConfigParseError("Unexpected token %s; %s" % (t, msg))
1181725
def _raise_error(self, *args, **kwargs):
        
        log.debug("_raise_error(): %s" % kwargs)
        try:
            error_code = str(kwargs['code'])
        except KeyError as e:
            raise FaultyPayloadError('_raise_error(): %s' % kwargs)

        try:
            raise self._code_handlers[error_code]()
        except KeyError:
            raise UnknownWSSError()
1298898
def runtime_error(self, msg, method):
        
        if self.testing:
            self._py3_wrapper.report_exception(msg)
            raise KeyboardInterrupt

        if self.error_hide:
            self.hide_errors()
            return

        # only show first line of error
        msg = msg.splitlines()[0]

        errors = [self.module_nice_name, u"{}: {}".format(self.module_nice_name, msg)]

        # if we have shown this error then keep in the same state
        if self.error_messages != errors:
            self.error_messages = errors
            self.error_index = 0
        self.error_output(self.error_messages[self.error_index], method)