Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/core/buckets/usecase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export class BucketsUsecase {
});

if (!bucketEntry) {
console.warn(`[getFileInfo] Bucket entry not found in DB - bucketId: ${bucketId}, fileId: ${fileId}`);
throw new BucketEntryNotFoundError(fileId);
}

Expand All @@ -238,6 +239,7 @@ export class BucketsUsecase {
if (axios.isAxiosError(error)) {
const axiosError = error as AxiosError;
if (axiosError.response?.status === 404) {
console.warn(`[getFileInfo] Download links returned 404 - bucketEntryId: ${bucketEntry.id}, fileId: ${fileId}, url: ${axiosError.config?.url}`);
throw new BucketEntryNotFoundError(fileId);
}
}
Expand Down
3 changes: 3 additions & 0 deletions lib/server/routes/buckets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,9 @@ BucketsRouter.prototype.getFileInfo = async function (req, res, next) {
return res.status(200).send(fileInfo);
} catch (err) {
if (err instanceof BucketEntryNotFoundError || err instanceof BucketEntryFrameNotFoundError || err instanceof BucketNotFoundError) {
log.warn('getFileInfo: Not found - bucket: %s, file: %s, user: %s, client: %s, error: %s',
req.params.id, req.params.file, req.user?.uuid, driveClient, err.message);

return next(new errors.NotFoundError(err.message));
}

Expand Down
Loading