From 89fc0142625126b0a2923c9d625be5d201354bb7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 May 2023 11:25:24 +0200 Subject: Catch metrics error --- client/src/assets/player/shared/metrics/metrics-plugin.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/src/assets/player/shared') 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 @@ import videojs from 'video.js' import { PlaybackMetricCreate } from '../../../../../../shared/models' import { MetricsPluginOptions, PlayerMode, PlayerNetworkInfo } from '../../types' +import { logger } from '@root-helpers/logger' const Plugin = videojs.getPlugin('plugin') @@ -99,6 +100,7 @@ class MetricsPlugin extends Plugin { const headers = new Headers({ 'Content-type': 'application/json; charset=UTF-8' }) return fetch(this.metricsUrl, { method: 'POST', body: JSON.stringify(body), headers }) + .catch(err => logger.error('Cannot send metrics to the server.', err)) }, this.CONSTANTS.METRICS_INTERVAL) } -- cgit v1.2.3