Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

More info when logging the request

Chocobozzza9cb29dfc101
diff --git a/server/core/helpers/requests.ts b/server/core/helpers/requests.ts
index b2ce1c65d5..f8a0c3e2f0 100644
--- a/server/core/helpers/requests.ts
+++ b/server/core/helpers/requests.ts
@@ -14,9 +14,13 @@ const lTags = loggerTagsFactory('request')
export interface PeerTubeRequestError extends Error {
statusCode?: number
+
responseBody?: any
responseHeaders?: any
+
requestHeaders?: any
+ requestUrl?: any
+ requestMethod?: any
}
export type PeerTubeRequestOptions = {
@@ -251,6 +255,8 @@ function buildRequestError (error: RequestError) {
if (error.options) {
newError.requestHeaders = error.options.headers
+ newError.requestUrl = error.options.url
+ newError.requestMethod = error.options.method
}
return newError
diff --git a/server/core/lib/activitypub/playlists/create-update.ts b/server/core/lib/activitypub/playlists/create-update.ts
index 7de5664bd5..257224fb1f 100644
--- a/server/core/lib/activitypub/playlists/create-update.ts
+++ b/server/core/lib/activitypub/playlists/create-update.ts
@@ -38,7 +38,7 @@ async function createAccountPlaylists (playlistUrls: string[]) {
return createOrUpdateVideoPlaylist(playlistObject)
} catch (err) {
- logger.warn('Cannot add playlist element %s.', playlistUrl, { err, ...lTags(playlistUrl) })
+ logger.warn('Cannot add playlist element ' + playlistUrl, { err, ...lTags(playlistUrl) })
}
}, { concurrency: CRAWL_REQUEST_CONCURRENCY })
}
@@ -149,7 +149,7 @@ async function buildElementsDBAttributes (elementUrls: string[], playlist: MVide
elementsToCreate.push(playlistElementObjectToDBAttributes(elementObject, playlist, video))
} catch (err) {
- logger.warn('Cannot add playlist element %s.', elementUrl, { err, ...lTags(playlist.uuid, playlist.url) })
+ logger.warn('Cannot add playlist element ' + elementUrl, { err, ...lTags(playlist.uuid, playlist.url) })
}
}, { concurrency: CRAWL_REQUEST_CONCURRENCY })
diff --git a/server/core/lib/activitypub/process/process-delete.ts b/server/core/lib/activitypub/process/process-delete.ts
index 0e9f8888eb..1c1404fcb2 100644
--- a/server/core/lib/activitypub/process/process-delete.ts
+++ b/server/core/lib/activitypub/process/process-delete.ts
@@ -29,7 +29,7 @@ async function processDeleteActivity (options: APProcessorOptions<ActivityDelete
const byActorFull = await ActorModel.loadByUrlAndPopulateAccountAndChannel(byActor.url)
if (isAccountActor(byActorFull.type)) {
- if (!byActorFull.Account) throw new Error('Actor ' + byActorFull.url + ' is a person but we cannot find it in database.')
+ if (!byActorFull.Account) throw new Error(`Actor ${byActorFull.url} is a person but we cannot find the account in database.`)
const accountToDelete = byActorFull.Account as MAccountActor
accountToDelete.Actor = byActorFull