diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-13 10:17:47 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-13 10:17:47 +0200 |
commit | 14f7ad399fddd00362eabdf8d32e453ebc8be453 (patch) | |
tree | 517433d5787291a359bcd4db7ab9c27b0265ee7f | |
parent | 3b0525106d8742b5ebd6962219eaf105435f6fb9 (diff) | |
download | PeerTube-14f7ad399fddd00362eabdf8d32e453ebc8be453.tar.gz PeerTube-14f7ad399fddd00362eabdf8d32e453ebc8be453.tar.zst PeerTube-14f7ad399fddd00362eabdf8d32e453ebc8be453.zip |
Add more error logs
-rw-r--r-- | server/lib/activitypub/videos/get.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/server/lib/activitypub/videos/get.ts b/server/lib/activitypub/videos/get.ts index d7500c71a..b74df132c 100644 --- a/server/lib/activitypub/videos/get.ts +++ b/server/lib/activitypub/videos/get.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | 1 | import { retryTransactionWrapper } from '@server/helpers/database-utils' |
2 | import { logger } from '@server/helpers/logger' | ||
2 | import { JobQueue } from '@server/lib/job-queue' | 3 | import { JobQueue } from '@server/lib/job-queue' |
3 | import { loadVideoByUrl, VideoLoadByUrlType } from '@server/lib/model-loaders' | 4 | import { loadVideoByUrl, VideoLoadByUrlType } from '@server/lib/model-loaders' |
4 | import { MVideoAccountLightBlacklistAllFiles, MVideoImmutable, MVideoThumbnail } from '@server/types/models' | 5 | import { MVideoAccountLightBlacklistAllFiles, MVideoImmutable, MVideoThumbnail } from '@server/types/models' |
@@ -77,6 +78,8 @@ async function getOrCreateAPVideo ( | |||
77 | if (err.name === 'SequelizeUniqueConstraintError') { | 78 | if (err.name === 'SequelizeUniqueConstraintError') { |
78 | const alreadyCreatedVideo = await loadVideoByUrl(videoUrl, fetchType) | 79 | const alreadyCreatedVideo = await loadVideoByUrl(videoUrl, fetchType) |
79 | if (alreadyCreatedVideo) return { video: alreadyCreatedVideo, created: false } | 80 | if (alreadyCreatedVideo) return { video: alreadyCreatedVideo, created: false } |
81 | |||
82 | logger.error('Cannot create video %s because of SequelizeUniqueConstraintError error, but cannot find it in database.', videoUrl) | ||
80 | } | 83 | } |
81 | 84 | ||
82 | throw err | 85 | throw err |