Formats exception message + cause
    :param e:
    :param message:
    :param cause:
    :return: formatted message, includes cause if any is set
174943
def error_message(e, message=None, cause=None):
    
    if message is None and cause is None:
        return None
    elif message is None:
        return '%s, caused by %r' % (e.__class__, cause)
    elif cause is None:
        return message
    else:
        return '%s, caused by %r' % (message, cause)
21036
public void error( Element e, String msg, Object... args ) {
        messager.printMessage( Diagnostic.Kind.ERROR, String.format( msg, args ), e );
    }
868738
static void showErrorMessage(Exception e, Component parent) {
    String msg = e.getMessage();
    JOptionPane.showMessageDialog(parent, msg, "Error", JOptionPane.ERROR_MESSAGE);
    e.printStackTrace();
  }
989665
def FormatException(self, e, output):
    """"""
    d = e.GetDictToFormat()
    for k in ('file_name', 'feedname', 'column_name'):
      if k in d.keys():
        d[k] = '<code>%s</code>' % d[k]
    if 'url' in d.keys():
      d['url'] = '<a href="%(url)s">%(url)s</a>' % d

    problem_text = e.FormatProblem(d).replace('\n', '<br>')
    problem_class = 'problem'
    if e.IsNotice():
      problem_class += ' notice'
    output.append('<li>')
    output.append('<div class="%s">%s</div>' %
                  (problem_class, transitfeed.EncodeUnicode(problem_text)))
    try:
      if hasattr(e, 'row_num'):
        line_str = 'line %d of ' % e.row_num
      else:
        line_str = ''
      output.append('in %s<code>%s</code><br>\n' %
                    (line_str, transitfeed.EncodeUnicode(e.file_name)))
      row = e.row
      headers = e.headers
      column_name = e.column_name
      table_header = ''  # HTML
      table_data = ''  # HTML
      for header, value in zip(headers, row):
        attributes = ''
        if header == column_name:
          attributes = ' class="problem"'
        table_header += '<th%s>%s</th>' % (attributes, header)
        table_data += '<td%s>%s</td>' % (attributes, value)
      # Make sure output is encoded into UTF-8
      output.append('<table class="dump"><tr>%s</tr>\n' %
                    transitfeed.EncodeUnicode(table_header))
      output.append('<tr>%s</tr></table>\n' %
                    transitfeed.EncodeUnicode(table_data))
    except AttributeError as e:
      pass  # Hope this was getting an attribute from e ;-)
    output.append('<br></li>\n')
1249818
def make_exception_message(exc):
    
    if str(exc):
        return '%s: %s\n' % (exc.__class__.__name__, exc)
    else:
        return '%s\n' % (exc.__class__.__name__)
873951
def _handle_except(e):
    
    exc_type, exc_obj, exc_tb = sys.exc_info()
    fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
    log.msg_err("Unhandled {e} at {file}:{line}: '{msg}'"
                .format(e=exc_type.__name__, file=fname,
                        line=exc_tb.tb_lineno,  msg=e))
    log.msg_err(traceback.format_exc())
    log.msg_err("An error has occurred!. "
                "For more details, review the logs.")
    return 1
115617
def add_cause(self, error: Exception):
        ''''''
        self.add_info('Cause error', '{0} - {1}'.format(type(error).__name__, error))
689512
def error(message, *args, **kwargs):
    

    print('[!] ' + message.format(*args, **kwargs))
    sys.exit(1)
1223828
def format_exception(e):
    
    from .utils.printing import fill
    return '\n'.join(fill(line) for line in traceback.format_exception_only(type(e), e))
793566
protected String getErrorMessage(Exception e) {

		String ip;
		try {
			ip = InetAddress.getByName(server.split(":")[0]).getHostAddress();
		}
		catch (UnknownHostException e1) {
			ip = null;
			// throw new RuntimeException(e1.getMessage(), e1);
		}
		String message = "server:" + server + " ip:" + ip + " messsage:" + e.getMessage();
		logger.error(message);
		return message;
	}
477156
def exception(self, e):
        
        self.logged_exception(e)
        self.logger.exception(e)
531365
public void error(CharSequence message, Throwable e) {
    log(Level.SEVERE, message, e);
  }
527395
def check_for_message_exception(cls, message_result):
        
        exception = message_result.exception

        if isinstance(exception, BaseException):
            raise exception
1198290
def exception(self, msg=None, *args, **kwargs):
        
        kwargs['exc_info'] = 1
        return self._log(logging.ERROR, msg, args, kwargs)
980831
public static String getExceptionMessage(Exception e) {
        if (e.getCause() != null && e.getCause().getMessage() != null) {
            String s = getscard(e.getCause().getMessage());
            if (s != null)
                return s;
        }
        if (e.getMessage() != null) {
            String s = getscard(e.getMessage());
            if (s != null)
                return s;
        }
        return e.getMessage();
    }
522567
def logged_exception(self, e):
        
        if str(e) not in self._errors:
            self._errors.append(str(e))

        self.set_error_state()
        self.buildstate.state.exception_type = str(e.__class__.__name__)
        self.buildstate.state.exception = str(e)
935065
def format_exception(exception):
    
    exception_lines = traceback.format_exception(*exception)
    # The lines returned from format_exception do not strictly contain
    # one line per element in the list (i.e. some elements have new
    # line characters in the middle). Normalize that oddity.
    lines = "".join(exception_lines).splitlines(True)
    return format_as_diagnostics(lines)