Helper for printing out errors before exiting
559067
function( code, e, message ) {
		var callback = munit.render.callback;

		// Force a numeric code for the first parameter
		if ( ! munit.isNumber( code ) ) {
			throw new Error( "Numeric code parameter required for munit.exit" );
		}

		// Allow code, message only arguments
		if ( message === undefined && munit.isString( e ) ) {
			message = e;
			e = null;
		}

		// Messaging
		if ( munit.isString( message ) ) {
			munit.color.red( message );
		}

		// Force an error object for callbacks
		if ( ! munit.isError( e ) ) {
			e = new Error( message || 'munit exited' );
		}
		e.code = code;

		// Only print out stack trace on an active process
		if ( munit.render.state !== munit.RENDER_STATE_COMPLETE ) {
			munit.log( e.stack );
		}

		// Callback takes priority
		if ( callback ) {
			munit.render.callback = undefined;
			callback( e, munit );
		}
		// No callback, end the process
		else {
			munit._exit( code );
		}
	}
926562
def ready_print(worker, output, error):  # pragma : no cover
    """"""
    global COUNTER
    COUNTER += 1
    print(COUNTER, output, error)
838501
def check_errors(self):
        '''
        
        '''
        errors = ERROR_PATTTERN.findall(self.out)
        # "errors" is a list of tuples
        if errors:
            self.log.error('! Errors occurred:')

            self.log.error('\n'.join(
                [error.replace('\r', '').strip() for error
                 in chain(*errors) if error.strip()]
            ))

            self.log.error('! See "%s.log" for details.' % self.project_name)

            if self.opt.exit_on_error:
                self.log.error('! Exiting...')
                sys.exit(1)
1004233
def error(message, *args, **kwargs):
    
    if 'end' in kwargs:
        end = kwargs['end']
    else:
        end = '\n'

    if len(args) == 0:
        sys.stderr.write(message)
    else:
        sys.stderr.write(message % args)
    sys.stderr.write(end)
    sys.stderr.flush()
977732
function printErrors(summary, errors) {
  logError(`${summary}\n`);

  errors.forEach(err => {
    logError(`\t- ${err.message || err}`);
  });

  console.log();
}
932094
def print_errors(function):
    """"""

    def wrapper(*args, **kwargs):
        try:
            return function(*args, **kwargs)
        except BaseException as e:
            print ("Exception raise calling %s: %s"
                   % (reflect.canonical_name(function),
                      get_exception_message(e)))
            raise

    return wrapper
1367989
def try_printout(data, out, opts, **kwargs):
    '''
    
    '''
    try:
        printout = get_printout(out, opts)(data, **kwargs)
        if printout is not None:
            return printout.rstrip()
    except (KeyError, AttributeError, TypeError):
        log.debug(traceback.format_exc())
        try:
            printout = get_printout('nested', opts)(data, **kwargs)
            if printout is not None:
                return printout.rstrip()
        except (KeyError, AttributeError, TypeError):
            log.error('Nested output failed: ', exc_info=True)
            printout = get_printout('raw', opts)(data, **kwargs)
            if printout is not None:
                return printout.rstrip()
903310
def print_error(error: "GraphQLError") -> str:
    
    printed_locations: List[str] = []
    print_location = printed_locations.append
    if error.nodes:
        for node in error.nodes:
            if node.loc:
                print_location(
                    highlight_source_at_location(
                        node.loc.source, node.loc.source.get_location(node.loc.start)
                    )
                )
    elif error.source and error.locations:
        source = error.source
        for location in error.locations:
            print_location(highlight_source_at_location(source, location))
    if printed_locations:
        return "\n\n".join([error.message] + printed_locations) + "\n"
    return error.message
628848
def print_error_to_io_stream(err: Exception, io: TextIOBase, print_big_traceback : bool = True):
    
    if print_big_traceback:
        traceback.print_tb(err.__traceback__, file=io, limit=-GLOBAL_CONFIG.multiple_errors_tb_limit)
    else:
        traceback.print_tb(err.__traceback__, file=io, limit=-1)
    io.writelines('  ' + str(err.__class__.__name__) + ' : ' + str(err))
689512
def error(message, *args, **kwargs):
    

    print('[!] ' + message.format(*args, **kwargs))
    sys.exit(1)
1006709
def errorprint():
    """"""
    try:
        yield

    except ConfigurationError as e:
        click.secho('%s' % e, err=True, fg='red')
        sys.exit(1)
494097
function onOutError(err) {
    errNodecat = combineErrors(errNodecat, err);
    errStream.write(`nodecat: ${err}\n`);
    if (inCleanup) {
      inCleanup();
    }
    allDone();
  }
231152
def error(self, message, print_help=False):
        """"""
        if 'too few arguments' in message.lower():
            target = sys.argv.pop(0)
            sys.argv.insert(
                0, os.path.basename(target) or os.path.relpath(target))
            message = ("%s. Try getting help with `%s --help`"
                       % (message, " ".join(sys.argv)))
        if print_help:
            self.print_help()
        else:
            self.print_usage()
        sys.stderr.write('\nerror: %s\n' % message)
        sys.exit(2)
475359
def pretty_print_error(err_json):
    """"""
    # Special case validation errors
    if len(err_json) == 1 and "validationOf" in err_json[0]:
        required_fields = ", ".join(err_json[0]["validationOf"]["required"])
        return "Validation error. Requires properties: {}.".format(required_fields)

    # General error handling
    msg = "; ".join(err.get("message", "") for err in err_json)

    # Fallback
    if not msg:
        msg = "Bad request."
    return msg
797750
def error(*args):
    """"""
    if sys.stdin.isatty():
        print('ERROR:', *args, file=sys.stderr)
    else:
        notify_error(*args)
546827
def handle_err(*args):
    
    if DEBUG:
        print_err(traceback.format_exc(), color=False)
    else:
        print_err(*args, newline=True)
396916
def error_message_and_exit(message, error_result):
    """"""
    if message:
        error_message(message)
    puts(json.dumps(error_result, indent=2))
    sys.exit(1)