Skip to content

Commit

Permalink
HPCC-32857 ECL Watch v9 Logs grid timestamp formatter
Browse files Browse the repository at this point in the history
fixes an issue with the ECL Watch v9 Logs viewer potentially having an
uncaught JS exception if the logging engine is misconfigured and the
value provided as the "timestamp" for a log message cannot be converted
to a valid date

Signed-off-by: Jeremy Clements <[email protected]>
  • Loading branch information
jeclrsg committed Oct 24, 2024
1 parent 4a7afe3 commit 620b3a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion esp/src/src-react/components/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export const Logs: React.FunctionComponent<LogsProps> = ({
formatter: ts => {
if (ts) {
if (ts.indexOf(":") < 0) {
return timestampToDate(ts).toISOString();
const date = timestampToDate(ts);
if (!isNaN(date.getTime())) {
return date.toISOString();
}
return ts;
}
return formatDateString(ts);
}
Expand Down

0 comments on commit 620b3a5

Please sign in to comment.