Throw exception if json_encode fails to encode the job payload.