diff --git a/src/components/LivenessQuickStart/index.tsx b/src/components/LivenessQuickStart/index.tsx index 64cadf29..964b9d98 100644 --- a/src/components/LivenessQuickStart/index.tsx +++ b/src/components/LivenessQuickStart/index.tsx @@ -102,11 +102,21 @@ export function LivenessQuickStart({ cedula }: Props) { region="us-east-1" onUserCancel={onUserCancel} onError={({ error, state }) => { + let message = error.message; + + if (message.includes('{"Message"')) { + message = JSON.parse(message).Message?.split(':')[0]; + } + + if (message.includes('Signature')) { + AlertError(intl.liveness.error.signature); + } + if (state === 'CAMERA_ACCESS_ERROR') { AlertError(intl.liveness.camera.notFound.heading); } - Sentry.captureMessage(error.message, { + Sentry.captureMessage(message, { user: { id: cedula }, extra: { state, error }, level: 'error', diff --git a/src/dictionaries/en.json b/src/dictionaries/en.json index 85a9dc8d..d5d9365a 100644 --- a/src/dictionaries/en.json +++ b/src/dictionaries/en.json @@ -124,6 +124,7 @@ "permissions": "Process again" }, "error": { + "signature": "Signature has expired. Please verify your system's time settings and attempt again.", "timeout": { "heading": "Time's up", "message": "The face did not fill the oval within the time limit. Try again and completely fill the oval with your face in 7 seconds." diff --git a/src/dictionaries/es.json b/src/dictionaries/es.json index eb43591a..054179e9 100644 --- a/src/dictionaries/es.json +++ b/src/dictionaries/es.json @@ -124,6 +124,7 @@ "permissions": "Procesar de nuevo" }, "error": { + "signature": "Firma expirada. Verifique la configuración de hora de su sistema e intente de nuevo.", "timeout": { "heading": "Se acabó el tiempo", "message": "La cara no llenó el óvalo dentro del límite de tiempo. Vuelva a intentarlo y llene completamente el óvalo con la cara en 7 segundos."