Webapp: catch error when job cannot be found

Fetching a non-existent job can happen due to the asynchronous nature
of the webapp, when a job was just deleted. It now no longer complains
about this in the JS debug console.
This commit is contained in:
Sybren A. Stüvel 2023-02-21 10:38:58 +01:00
parent 12f4d9b5ce
commit b22ea953d5

View File

@ -231,7 +231,16 @@ export default {
// Forward the full job to Tabulator, so that that gets updated too. // Forward the full job to Tabulator, so that that gets updated too.
this.$refs.jobsTable.processJobUpdate(job); this.$refs.jobsTable.processJobUpdate(job);
this._recalcTasksTableHeight(); this._recalcTasksTableHeight();
}); })
.catch((err) => {
if (err.status == 404) {
// It can happen that a job cannot be found, for example when it was asynchronously deleted.
this.jobs.deselectAllJobs();
return;
}
console.log(`Unable to fetch job ${jobID}:`, err);
})
;
}, },
/** /**