import React, { useState } from 'react' import ErrorFrame from '../ErrorFrame/ErrorFrame' import cn from 'classnames'; import { IconButton, Icon } from 'UI'; import { connect } from 'react-redux'; const docLink = 'https://docs.openreplay.com/plugins/sourcemaps'; function ErrorDetails({ className, name = "Error", message, errorStack, sourcemapUploaded }) { const [showRaw, setShowRaw] = useState(false) const firstFunc = errorStack.first() && errorStack.first().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

setShowRaw(false) } label="FULL" plain={!showRaw} primaryText={!showRaw} /> setShowRaw(true) } plain={showRaw} label="RAW" />
{ name }
{message}
{ showRaw &&
{name} : {firstFunc ? firstFunc : '?' }
} { errorStack.map((frame, i) => (
)) }
) } ErrorDetails.displayName = "ErrorDetails"; export default ErrorDetails;