mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
Gracefully handle when playback time might be a invalid date value (#126)
Co-authored-by: Warren <5959690+wrn14897@users.noreply.github.com>
This commit is contained in:
parent
03f78dde12
commit
778492123c
2 changed files with 12 additions and 1 deletions
6
.changeset/spicy-elephants-develop.md
Normal file
6
.changeset/spicy-elephants-develop.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
'@hyperdx/app': patch
|
||||
---
|
||||
|
||||
Fix: Don't crash session replay player when playback timestamp is not a valid
|
||||
date
|
||||
|
|
@ -28,7 +28,12 @@ function formatTs({
|
|||
const seconds = Math.floor((value / 1000) % 60);
|
||||
return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
||||
} else {
|
||||
return format(new Date(ts), 'hh:mm:ss a');
|
||||
try {
|
||||
return format(new Date(ts), 'hh:mm:ss a');
|
||||
} catch (err) {
|
||||
console.error(err, ts);
|
||||
return '--:--';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue