Outputs a message and returns an appropriate error code for the specified
 exception.
343946
def handle_exception(exception)
      case exception
      when HamlLint::Exceptions::ConfigurationError
        log.error exception.message
        Sysexits::EX_CONFIG
      when HamlLint::Exceptions::InvalidCLIOption
        log.error exception.message
        log.log "Run `#{APP_NAME}` --help for usage documentation"
        Sysexits::EX_USAGE
      when HamlLint::Exceptions::InvalidFilePath
        log.error exception.message
        Sysexits::EX_NOINPUT
      when HamlLint::Exceptions::NoLintersError
        log.error exception.message
        Sysexits::EX_NOINPUT
      else
        print_unexpected_exception(exception)
        Sysexits::EX_SOFTWARE
      end
    end
335140
public Collection<Exception> error(final Object message, final Throwable error) {
        return Lists.reverse(errorHandlers).stream()
                .flatMap(f -> f.apply(message, error).map(Stream::of).orElse(Stream.empty()))
                .collect(Collectors.toList());
    }
964969
public static void error(Object... message) {
        StringBuilder builder = new StringBuilder(APP_ERROR);
        for (Object object : message) {
            builder.append(object.toString());
        }
        errorStream.println(builder.toString());
    }
584663
def error(code, message, **kwargs):
        """"""
        assert code in Logger._error_code_to_exception
        exc_type, domain = Logger._error_code_to_exception[code]
        exc = exc_type(message, **kwargs)
        Logger._log(code, exc.message, ERROR, domain)
        raise exc
571156
def error(self, message: str) -> None:
        """"""
        if len(self._custom_error_message) > 0:
            message = self._custom_error_message
            self._custom_error_message = ''

        lines = message.split('\n')
        linum = 0
        formatted_message = ''
        for line in lines:
            if linum == 0:
                formatted_message = 'Error: ' + line
            else:
                formatted_message += '\n       ' + line
            linum += 1

        sys.stderr.write(Fore.LIGHTRED_EX + '{}\n\n'.format(formatted_message) + Fore.RESET)
        # sys.stderr.write('{}\n\n'.format(formatted_message))
        self.print_help()
        sys.exit(1)
803400
private String getExceptionMessage(Throwable pException) {
        String message = pException.getLocalizedMessage();
        return pException.getClass().getName() + (message != null ? " : " + message : "");
    }
305537
def get_exception_message(instance):
    ''''''
    args = getattr(instance, 'args', None)

    if args:
        return str(instance)

    try:
        return type(instance).__name__
    except AttributeError:
        return str(instance)
916484
def get_error_message(status_code):
    """"""
    errmsg = ctypes.create_string_buffer(1024)
    nican.ncStatusToString(status_code, len(errmsg), errmsg)
    return errmsg.value.decode("ascii")
1315657
function Exception(code, message) {
    const factory = Object.create(Exception.prototype);
    factory.code = code;
    factory.message = message;
    factory.stack = factory.toString();
    return factory;
}
479361
def process_exception_message(exception):
        
        exception_message = str(exception)
        for replace_char in ['\t', '\n', '\\n']:
            exception_message = exception_message.replace(replace_char, '' if replace_char != '\t' else ' ')
        return exception_message.replace('section', 'alias')
690158
def error_message(self):
        ""
        output = self.msg + ", code " + str(self.code)
        output += ". Request Time={}, Request ID={}".format(self.timestamp, self.req_id)
        if self.name != self.__class__.__name__:
            output = self.name + ": " + output
        return output
1195380
def parse_error(self, exception=ParseError, *args):
        
        return self._src.parse_error(exception, *args)
695001
public void error(final int errorCode, final String message) {
		try {
			this.response.sendError(errorCode, message);
		} catch (final IOException e) {
			e.printStackTrace();
		}
	}
879448
def error(self, message, code=1):
        
        sys.stderr.write(message)
        sys.exit(code)
90947
protected String createExceptionMessage(final String message, final Object... messageParameters) {

        if (ArrayUtils.isEmpty(messageParameters)) {
            return message;
        } else {
            return String.format(message, messageParameters);
        }
    }
1307194
def parse_error(
        self, exception=ParseError, *args
    ):  # type: (ParseError.__class__, ...) -> ParseError
        
        line, col = self._to_linecol()

        return exception(line, col, *args)
242977
def message_for_exception(exception: Exception, message: str) -> Sequence[Token]:
    
    tb = sys.exc_info()[2]
    buffer = io.StringIO()
    traceback.print_tb(tb, file=io)  # type: ignore
    # fmt: off
    return (
        red, message + "\n",
        exception.__class__.__name__,
        str(exception), "\n",
        reset, buffer.getvalue()
    )