1
0
Fork 0

wip(lab): Working on crash reporting in the new dev env

This commit is contained in:
Joost De Cock 2022-03-18 19:11:00 +01:00
parent f100691a92
commit 8a2a13f240
7 changed files with 164 additions and 61 deletions

View file

@ -1,3 +1,4 @@
import React from 'react'
import TextOnPath from '../text-on-path'
import { getProps } from '../utils'
@ -21,9 +22,15 @@ const Path = props => {
if (!path.render) return null
const output = []
const pathId = 'path-' + partName + '-' + pathName
output.push(
<path id={pathId} key={pathId} d={path.asPathstring()} {...getProps(path)} />
)
let d = ''
try { d = path.asPathstring() }
catch (err) {
// Bail out
console.log(`Failed to generate pathstring for path ${pathId} in part ${partName}`, err)
return null
}
output.push(<path id={pathId} key={pathId} d={d} {...getProps(path)} />)
if (path.attributes.get('data-text'))
output.push(<TextOnPath key={'text-on-path-' + name} pathId={pathId} {...props} />)
if (props.gist._state?.xray?.enabled) output.push(<XrayPath {...props} key={'xpath'+pathId} />)