From 329e2927d2b37c37a71c7d5042c64c0b27610cb9 Mon Sep 17 00:00:00 2001 From: Andres Pinto Date: Fri, 3 Jan 2025 14:31:36 -0400 Subject: [PATCH] chore: add logger to finishUpload endpoint --- lib/server/routes/buckets.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/server/routes/buckets.js b/lib/server/routes/buckets.js index a340646f..db34108b 100644 --- a/lib/server/routes/buckets.js +++ b/lib/server/routes/buckets.js @@ -1210,6 +1210,7 @@ BucketsRouter.prototype.startUpload = async function (req, res, next) { // eslint-disable-next-line complexity BucketsRouter.prototype.finishUpload = async function (req, res, next) { const bucketId = req.params.id; + const driveClient = req.headers['internxt-client']; if (!req.body.index || !req.body.shards) { return next(new errors.BadRequestError('Missing parameters')); @@ -1270,6 +1271,8 @@ BucketsRouter.prototype.finishUpload = async function (req, res, next) { return next(new errors.TransferRateError(err.message)); } + log.error('finishUpload: Error for bucket %s: for user: %s, client: %s %s. %s', bucketId, req.user.uuid, driveClient, err.message, err.stack); + return next(new errors.InternalError(err.message)); } };