def METHOD_NAME(io_os_error, message):
    """
    Given an IOError or OSError exception, print the message to stdout, and then print relevant
    stats about the exception to stdout before exiting with error code 1.
    """
    o = io_os_error
    sys.stderr.write('{}\n'.format(message))
    # errno and strerror are common to IOError and OSError
    sys.stderr.write('Error [{}]: {}\n'.format(o.errno, o.strerror))
    sys.exit(1)