I've node program which in case of error needs to send error message , this works, however I want to add to the message also a link.
something like
Something went wrong and we cannot open your application.
Follow this tutorial to proceed.
And the this tutorial will be a link e.g. https://nodejs.org/en/about/
How can I do that?
...
} catch (e) {
throw new Error('Something went wrong and we cannot open your application.Follow <a href="https://nodejs.org/en/about/">this</a> tutorial to proceed.'
)
}
And I send the data via express like res.send
app.get('/', async function (req, res) {
try {
const url = await invokeApp()
} catch (e) {
res.send(e.message)
}
})
update
while trying the suggestion below I able to get the link but the messege order was changed, any idea how to fix it ?
} catch (e) {
throw new Error('Something went wrong and we cannot open your application.Follow <a href="https://nodejs.org/en/about/">this</a> tutorial to proceed.'
)
}
