From 2142c82b5a803f35a09645a3426d37ac3f64fe8c Mon Sep 17 00:00:00 2001 From: David Newell Date: Mon, 18 Mar 2024 17:08:13 +0000 Subject: [PATCH] add title parsing --- .../errors/SessionRecordingErrors.tsx | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/frontend/src/scenes/session-recordings/errors/SessionRecordingErrors.tsx b/frontend/src/scenes/session-recordings/errors/SessionRecordingErrors.tsx index 1de5d03f3cd35..f4abc45382b76 100644 --- a/frontend/src/scenes/session-recordings/errors/SessionRecordingErrors.tsx +++ b/frontend/src/scenes/session-recordings/errors/SessionRecordingErrors.tsx @@ -33,14 +33,14 @@ export function SessionRecordingErrors(): JSX.Element { { title: 'Error', dataIndex: 'cluster', - render: (_, cluster) => ( -
- {cluster.sample.error} -
- ), + render: (_, cluster) => { + const displayTitle = parseTitle(cluster.sample.error) + return ( +
+ {displayTitle} +
+ ) + }, width: '50%', }, { @@ -124,3 +124,12 @@ function isJSON(str: string): boolean { return false } } + +function parseTitle(error: string): string { + try { + const parsedError = JSON.parse(error) + return parsedError.error || error + } catch { + return error + } +}