def METHOD_NAME(queue, job_ids):
    if job_ids:
        for job_id in job_ids:
            j = Job.fetch(job_id, connection=connection)
            print(f"JOB ID {job_id}")
            print("KWARGS")
            print(j.kwargs)
            print("\nARGS")
            print(j.args)
            print("\nEXCEPTION")
            print(j.exc_info)
    else:
        q = Queue(queue, connection=connection)
        ids = q.failed_job_registry.get_job_ids()
        print("\n".join(ids))