mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor(server)!: move correlationId to X-Correlation-ID response header (#28139)
This commit is contained in:
@@ -20,14 +20,16 @@ export class GlobalExceptionFilter implements ExceptionFilter<Error> {
|
||||
const response = ctx.getResponse<Response>();
|
||||
const { status, body } = this.fromError(error);
|
||||
if (!response.headersSent) {
|
||||
response.status(status).json({ ...body, statusCode: status, correlationId: this.cls.getId() });
|
||||
response.header('X-Correlation-ID', this.cls.getId());
|
||||
response.status(status).json({ ...body, statusCode: status });
|
||||
}
|
||||
}
|
||||
|
||||
handleError(res: Response, error: Error) {
|
||||
const { status, body } = this.fromError(error);
|
||||
if (!res.headersSent) {
|
||||
res.status(status).json({ ...body, statusCode: status, correlationId: this.cls.getId() });
|
||||
res.header('X-Correlation-ID', this.cls.getId());
|
||||
res.status(status).json({ ...body, statusCode: status });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user