Added migration for failed jobs DB and addedsome exceptions handling