Added handling for job error and andded JobError class
Fixed tests for job error