Skip to content

Commit

Permalink
chore: add logger to finishUpload endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
apsantiso committed Jan 3, 2025
1 parent e5fc5bd commit 329e292
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/server/routes/buckets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down Expand Up @@ -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));
}
};
Expand Down

0 comments on commit 329e292

Please sign in to comment.