Fixed variable referenced before assignment error when handling a job exception.