refactor(core): Switch plain errors in cli to ApplicationError (#7857)
Ensure all errors in `cli` are `ApplicationError` or children of it and contain no variables in the message, to continue normalizing all the errors we report to Sentry Follow-up to: https://github.com/n8n-io/n8n/pull/7839
This commit is contained in:
@@ -27,7 +27,7 @@ import type {
|
||||
IExecutionsSummary,
|
||||
IN8nUISettings,
|
||||
} from 'n8n-workflow';
|
||||
import { jsonParse } from 'n8n-workflow';
|
||||
import { ApplicationError, jsonParse } from 'n8n-workflow';
|
||||
|
||||
// @ts-ignore
|
||||
import timezones from 'google-timezones-json';
|
||||
@@ -672,7 +672,9 @@ export class Server extends AbstractServer {
|
||||
const job = currentJobs.find((job) => job.data.executionId === req.params.id);
|
||||
|
||||
if (!job) {
|
||||
throw new Error(`Could not stop "${req.params.id}" as it is no longer in queue.`);
|
||||
throw new ApplicationError('Could not stop job because it is no longer in queue.', {
|
||||
extra: { jobId: req.params.id },
|
||||
});
|
||||
} else {
|
||||
await queue.stopJob(job);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user