Improved logging & add graphicsmagick to docker file.
This commit is contained in:
@@ -27,7 +27,9 @@ export const BillsMediaUploadMulter = multer({
|
||||
cb(null, DestinationFolder);
|
||||
},
|
||||
filename: function (req, file, cb) {
|
||||
logger.info("Uploading file: ", path.basename(file.originalname));
|
||||
logger.info("Uploading file: ", {
|
||||
file: path.basename(file.originalname),
|
||||
});
|
||||
const invoice_number: string = (req.body.invoice_number || "").trim();
|
||||
|
||||
cb(null, generateUniqueBillFilename(file, invoice_number));
|
||||
@@ -75,8 +77,11 @@ export async function BillsUploadMedia(req: Request, res: Response) {
|
||||
|
||||
BillsListMedia(req, res);
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error("Error while uploading Bill Media", req.files, err);
|
||||
res.status(500).send(err);
|
||||
} catch (error) {
|
||||
logger.error("Error while uploading Bill Media", {
|
||||
files: req.files,
|
||||
error,
|
||||
});
|
||||
res.status(500).send(error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user