I don’t receive events, on front I do but with this implementation of Sentry on the backend I don’t receive events.
I’m trying, to trigger an event, to make impossible database select or error in server connect (the kind of error where with the debug flag on you can see the full stacktrace in front).
But I don’t know how Wappler is build, so I don’t know what kind of errors I can expect to catch with the middleware express from Sentry.
You should add the error handler after all the other routes. In the server.js place it in the start function, there we also add the 404 and error handler for server connect. Place it just in from of those.
module.exports = {
server, app, io,
start: function(port) {
app.use(Sentry.Handlers.errorHandler()); // <-- added the error handler here
// We add the 404 and 500 routes as last
app.use((req, res) => {
res.status(404).json({
status: '404',
message: `${req.url} not found.`
});
});
Hi @Eldynn - thank you for this - I’d be very interested in integrating Sentry into FE and BE. The free tier only works with a direct integration, rather than via a third party tool like Segment - would you be willing to do a step-by-step instruction of how to integrate into a nodejs project so that (selfishly) I can follow this, and perhaps others on the forum?