Capture your First Error
Now that the Demo App is up and running on your local environment integrated with the Sentry SDK, you’re ready to generate the first error.
Step 1: Capture your First Event
Launch the demo app by opening the localhost link in your browser
Click on any of the Buy! buttons to add products to your shopping cart
Click on the Checkout button on the left panel to generate an error
- An error message Something went wrong displays in the app
- The error stack trace shows in the browser console
An alert sent to your email address configured on Sentry.io notifying you about an error that occurred in your app
Step 2: Handle the Error
Go to your email inbox and open the email notification from Sentry
View on Sentryto view the full details and context of this error in your Sentry account
Note: Sentry aggregates similar errors (events) into one Issue
Scroll down to the
- Sentry can un-minify the code back to its readable form and display source (code) context lines in the stack frames, which is covered in the next tutorial.
Step 3: Create New Alerts
You can create various alert rules per project and let Sentry know when, how, and whom you want to notify when errors occur in your application. Alert rules consist of Conditions and Actions, which are performed when the associated conditions are met. For more information, see Alerts.
By default, each project is created with one initial alert rule, notifying all project team members (via email) the first time a new issue appears. This means that the next time the Checkout error occurs, the notification is not triggered since the error is not “new.”
In this step, you create a new Alert rule notifying every time an event occurs, even if it’s associated with an already existing issue.
Click on the cog icon next to the project name to open the
- Click on
Alertsto open the Alerts Configuration page
Notice the default alert rule already defined in your project
New Alert Rule
In the New Alert Rule form, enter the following values
The new alert rule notifies you every time an event is seen in All Environments via Mail
Save Ruleto create the new rule
- To test the new rule, reproduce the error in the demo app