Skip to content

Commit

Permalink
stringify error object before logging (#7466)
Browse files Browse the repository at this point in the history
* stringify error object before logging

* use handleError function

* remove unused code
  • Loading branch information
Joao-vi authored Nov 28, 2024
1 parent 320f45b commit 104edc7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/api/files/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { CSVLoader } from 'api/csv';
import entities from 'api/entities';
import { processDocument } from 'api/files/processDocument';
import { uploadMiddleware } from 'api/files/uploadMiddleware';
import { legacyLogger } from 'api/log';
import { permissionsContext } from 'api/permissions/permissionsContext';
import { validateAndCoerceRequest } from 'api/utils/validateRequest';
import { EntitySchema } from 'shared/types/entityType';
Expand Down Expand Up @@ -78,8 +77,7 @@ export default (app: Application) => {
res.json(savedFile);
req.emitToSessionSocket('documentProcessed', req.body.entity);
} catch (err) {
legacyLogger.error(err);
legacyLogger.debug(err);
handleError(err);
const [file] = await files.get({ filename: req.file.filename });
res.json(file);
req.emitToSessionSocket('conversionFailed', req.body.entity);
Expand Down

0 comments on commit 104edc7

Please sign in to comment.