mirror of https://github.com/Chocobozzz/PeerTube
More info when logging the request
parent
5ae90e0757
commit
a9cb29dfc1
|
@ -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
|
||||
|
|
|
@ -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 })
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue