1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-11-24 08:42:24 +02:00

Improving debug logging for face region generation #656

This commit is contained in:
Patrik J. Braun 2023-04-22 01:59:16 +02:00
parent 27d1270da6
commit 2aea6f4456

View File

@ -3,11 +3,7 @@ import * as fs from 'fs';
import {NextFunction, Request, Response} from 'express';
import {ErrorCodes, ErrorDTO} from '../../../common/entities/Error';
import {ContentWrapper} from '../../../common/entities/ConentWrapper';
import {
DirectoryPathDTO,
ParentDirectoryDTO,
SubDirectoryDTO,
} from '../../../common/entities/DirectoryDTO';
import {DirectoryPathDTO, ParentDirectoryDTO, SubDirectoryDTO,} from '../../../common/entities/DirectoryDTO';
import {ProjectPath} from '../../ProjectPath';
import {Config} from '../../../common/config/private/Config';
import {ThumbnailSourceType} from '../../model/threading/PhotoWorker';
@ -69,12 +65,14 @@ export class ThumbnailGeneratorMWs {
return next();
}
let erroredItem: PersonEntry = null;
try {
const size: number = Config.Media.Thumbnail.personThumbnailSize;
const persons: PersonEntry[] = req.resultPipe as PersonEntry[];
for (const item of persons) {
erroredItem = item;
if (!item.sampleRegion) {
continue;
}
@ -99,7 +97,7 @@ export class ThumbnailGeneratorMWs {
return next(
new ErrorDTO(
ErrorCodes.SERVER_ERROR,
'error during postprocessing result (adding thumbnail info for persons)',
`Error during postprocessing result: adding thumbnail info for persons. Failed on: person ${erroredItem?.name}, at ${erroredItem?.sampleRegion?.media?.name} `,
error.toString()
)
);