mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
fix(server): auto-reconnect to database (#12320)
This commit is contained in:
parent
1783dfd393
commit
12b65e3c24
10 changed files with 130 additions and 46 deletions
|
|
@ -9,6 +9,7 @@ import {
|
|||
} from '@nestjs/common';
|
||||
import { Observable, catchError, throwError } from 'rxjs';
|
||||
import { ILoggerRepository } from 'src/interfaces/logger.interface';
|
||||
import { logGlobalError } from 'src/utils/logger';
|
||||
import { routeToErrorMessage } from 'src/utils/misc';
|
||||
|
||||
@Injectable()
|
||||
|
|
@ -25,9 +26,10 @@ export class ErrorInterceptor implements NestInterceptor {
|
|||
return error;
|
||||
}
|
||||
|
||||
const errorMessage = routeToErrorMessage(context.getHandler().name);
|
||||
this.logger.error(errorMessage, error, error?.errors, error?.stack);
|
||||
return new InternalServerErrorException(errorMessage);
|
||||
logGlobalError(this.logger, error);
|
||||
|
||||
const message = routeToErrorMessage(context.getHandler().name);
|
||||
return new InternalServerErrorException(message);
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue