Skip to content

Commit

Permalink
added separate update on error send
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Oct 24, 2024
1 parent b855ff9 commit f43e0fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/nexrender-core/src/tasks/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ Estimated date of change to the new behavior: 2023-06-01.\n`);
job.onRenderError(job, new Error(matchError[1]));
}
errorSent = true
throw new Error(matchError[1]);
}

return data;
Expand Down
14 changes: 8 additions & 6 deletions packages/nexrender-worker/src/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,16 @@ const createWorker = () => {
}
}
})(client, settings);
currentJob.onRenderError = ((c, s, job) => (_, err) => {
job.error = [].concat(job.error || [], [err.toString()]);

currentJob.onRenderError = (currentJob, err /* on render error */) => {
currentJob.error = [].concat(currentJob.error || [], [err.toString()]);

if (settings.onRenderError) {
settings.onRenderError(currentJob, err);
if (s.onRenderError) {
s.onRenderError(job, err);
}
}

/* send render progress to our server */
c.updateJob(job.uid, getRenderingStatus(job));
})(client, settings, currentJob);

currentJob = await render(currentJob, settings); {
currentJob.state = 'finished';
Expand Down

0 comments on commit f43e0fc

Please sign in to comment.