I have used Sentry in my node backend. Here is the process
Sentry.init({
dsn: 'my address',
// ...
});
Sentry.captureException(new Error("Something broke"));
Now I didn't get either any error or mail. Why I did wrong here?
Do you let the app terminate immediately after running those two lines? If that's the case you likely killed the process before it had a change to flush (send to sentry) the event in its internal queue.
The docs describe the process of Shutting down and draining the queue.