Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const finish = nr.createTracer('finish', () => {
const RootComponent = getRootComponent(feature)
if (RootComponent === null) {
nr.endTransaction()
res.status(500).send({ error: 4, message: `No root component defined for this feature: ${feature}` })
}
getRenderProps(feature, params.url).then(nr.createTracer('getRenderProps', (renderProps) => {
let html = null
try {
html = renderToString()
} catch (ex) {
// throw new Error(`Error: 3 - Could Not Render ${feature} view`, ex)
Raven.captureException(ex)
nr.endTransaction()
res.status(500).send({ error: 3, message: `Could Not Render ${feature} view`, ex, stack: ex.stack })
}
const initialState = Object.assign({}, startingState, store.getState(), { hosts: { nodeHost: getNodeHost(req), railsHost: params.railsHost } })
)).finally(() => (
newrelic.endTransaction()
))
))()