0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-11 02:23:09 -05:00

fix(server): stringify error log parameter to ensure correct overload (#16422)

* fix(server): stringify error log parameter to ensure correct overload

The intended error(message, stack, context) overload is only selected if context is a string.

* formatter
This commit is contained in:
Desmond Cox 2025-02-28 18:50:00 +01:00 committed by GitHub
parent 84cf0d1670
commit 5c0538e52c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,7 +195,11 @@ export class JobService extends BaseService {
await this.onDone(job); await this.onDone(job);
} }
} catch (error: Error | any) { } catch (error: Error | any) {
this.logger.error(`Unable to run job handler (${queueName}/${job.name}): ${error}`, error?.stack, job.data); this.logger.error(
`Unable to run job handler (${queueName}/${job.name}): ${error}`,
error?.stack,
JSON.stringify(job.data),
);
} finally { } finally {
this.telemetryRepository.jobs.addToGauge(queueMetric, -1); this.telemetryRepository.jobs.addToGauge(queueMetric, -1);
} }