client: extend logging

In able to make it easier to debug issues.
This commit is contained in:
kontrollanten 2024-06-25 06:11:32 +02:00 committed by Chocobozzz
parent 4bc29f6d3f
commit 3c9d1ff5e3
2 changed files with 8 additions and 2 deletions

View File

@ -90,12 +90,13 @@ export class RestExtractor {
}
if (err.status !== undefined) {
// A fetch response
const errorMessage = this.buildServerErrorMessage(err)
const message = `Backend returned code ${err.status}, errorMessage is: ${errorMessage}`
if (err.status === HttpStatusCode.NOT_FOUND_404) logger.clientError(message)
else logger.error(message)
else logger.error(message, { type: err.type, url: err.url })
return errorMessage
}

View File

@ -306,7 +306,12 @@ export class PeerTubePlayer {
return
}
logger.info('Fast forwarding HLS to recover from an error.')
logger.info('Fast forwarding HLS to recover from an error.', {
err,
videoShortUUID: this.currentLoadOptions.videoShortUUID,
currentTime: this.player.currentTime(),
resolution: this.player.videoHeight()
})
this.videojsDecodeErrors++