<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_job(job_id):
 """Updates a job."""


    data = request.get_json(force=True)

    try:
        current_app.apscheduler.modify_job(job_id, **data)
        job = current_app.apscheduler.get_job(job_id)
        return jsonify(job)
    except JobLookupError:
        return jsonify(dict(error_message='Job %s not found' % job_id), status=404)
    except Exception as e:
        return jsonify(dict(error_message=str(e)), status=500)