aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-05-10 11:25:24 +0200
committerChocobozzz <me@florianbigard.com>2023-05-10 11:25:24 +0200
commit89fc0142625126b0a2923c9d625be5d201354bb7 (patch)
treefd637bf146b1caee16b2ce7286407d97fc1f03c6
parent34023e12534f22f28d0b5afc1db3fdf2fd1e7e60 (diff)
downloadPeerTube-89fc0142625126b0a2923c9d625be5d201354bb7.tar.gz
PeerTube-89fc0142625126b0a2923c9d625be5d201354bb7.tar.zst
PeerTube-89fc0142625126b0a2923c9d625be5d201354bb7.zip
Catch metrics error
-rw-r--r--client/src/assets/player/shared/metrics/metrics-plugin.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/src/assets/player/shared/metrics/metrics-plugin.ts b/client/src/assets/player/shared/metrics/metrics-plugin.ts
index 0e296bef6..2aae3e90a 100644
--- a/client/src/assets/player/shared/metrics/metrics-plugin.ts
+++ b/client/src/assets/player/shared/metrics/metrics-plugin.ts
@@ -1,6 +1,7 @@
1import videojs from 'video.js' 1import videojs from 'video.js'
2import { PlaybackMetricCreate } from '../../../../../../shared/models' 2import { PlaybackMetricCreate } from '../../../../../../shared/models'
3import { MetricsPluginOptions, PlayerMode, PlayerNetworkInfo } from '../../types' 3import { MetricsPluginOptions, PlayerMode, PlayerNetworkInfo } from '../../types'
4import { logger } from '@root-helpers/logger'
4 5
5const Plugin = videojs.getPlugin('plugin') 6const Plugin = videojs.getPlugin('plugin')
6 7
@@ -99,6 +100,7 @@ class MetricsPlugin extends Plugin {
99 const headers = new Headers({ 'Content-type': 'application/json; charset=UTF-8' }) 100 const headers = new Headers({ 'Content-type': 'application/json; charset=UTF-8' })
100 101
101 return fetch(this.metricsUrl, { method: 'POST', body: JSON.stringify(body), headers }) 102 return fetch(this.metricsUrl, { method: 'POST', body: JSON.stringify(body), headers })
103 .catch(err => logger.error('Cannot send metrics to the server.', err))
102 }, this.CONSTANTS.METRICS_INTERVAL) 104 }, this.CONSTANTS.METRICS_INTERVAL)
103 } 105 }
104 106