fix(queue-worker): don't send LLM extract hallucination error to Sentry

This commit is contained in:
Gergo Moricz 2024-09-13 14:02:49 +02:00
parent 0d1b46d476
commit f7c4cee404

View File

@ -448,11 +448,13 @@ async function processJob(job: Job, token: string) {
} catch (error) {
Logger.error(`🐂 Job errored ${job.id} - ${error}`);
Sentry.captureException(error, {
data: {
job: job.id,
},
});
if (!(error instanceof Error && error.message.includes("JSON parsing error(s): "))) {
Sentry.captureException(error, {
data: {
job: job.id,
},
});
}
if (error instanceof CustomError) {
// Here we handle the error, then save the failed job