import React, { useState } from 'react'; import ErrorFrame from '../ErrorFrame/ErrorFrame'; import { Button, Icon } from 'UI'; import { observer } from 'mobx-react-lite'; import { useStore } from 'App/mstore'; const docLink = 'https://docs.openreplay.com/installation/upload-sourcemaps'; interface Props { fetchErrorStackList: any; sourcemapUploaded?: boolean; errorStack?: any; message?: string; error: any; } function ErrorDetails(props: Props) { const { errorStore, sessionStore } = useStore(); const sessionId = sessionStore.current.sessionId; const errorStack = errorStore.instanceTrace; const { error, message = '', sourcemapUploaded = false } = props; const [showRaw, setShowRaw] = useState(false); const firstFunc = errorStack[0] && errorStack[0].function; const openDocs = () => { window.open(docLink, '_blank'); }; return (
{!sourcemapUploaded && (
Source maps must be uploaded to OpenReplay to be able to see stack traces.{' '} Learn more.
)}

Stacktrace

{error.name}
{message}
{showRaw && (
{error.name} : {firstFunc ? firstFunc : '?'}
)} {errorStack.map((frame: any, i: any) => (
))}
); } ErrorDetails.displayName = 'ErrorDetails'; export default observer(ErrorDetails);