@ministryofjustice/hmpps-connect-dps-shared-items 5.3.1 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,8 +56,7 @@ function hmppsWebcamCapture(component) {
|
|
|
56
56
|
photoCaptureContainer.style.display = 'none';
|
|
57
57
|
photoCaptureErrorContainer.style.display = 'block';
|
|
58
58
|
if (enableReporting) {
|
|
59
|
-
|
|
60
|
-
const error = 'name' in e ? e.name : e.message;
|
|
59
|
+
const error = (e && typeof e === 'object' && (('name' in e && e.name) || ('message' in e && e.message))) ?? 'Unknown';
|
|
61
60
|
// eslint-disable-next-line no-restricted-globals
|
|
62
61
|
await fetch(`/api/report-error?pageUrl=${encodeURIComponent(location.href)}&error=${error}`, {
|
|
63
62
|
method: 'GET',
|
|
@@ -66,8 +66,8 @@ function hmppsWebcamCapture(component: HTMLElement): Promise<void> {
|
|
|
66
66
|
photoCaptureContainer.style.display = 'none'
|
|
67
67
|
photoCaptureErrorContainer.style.display = 'block'
|
|
68
68
|
if (enableReporting) {
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
const error =
|
|
70
|
+
(e && typeof e === 'object' && (('name' in e && e.name) || ('message' in e && e.message))) ?? 'Unknown'
|
|
71
71
|
// eslint-disable-next-line no-restricted-globals
|
|
72
72
|
await fetch(`/api/report-error?pageUrl=${encodeURIComponent(location.href)}&error=${error}`, {
|
|
73
73
|
method: 'GET',
|
package/package.json
CHANGED