Capture Your First Error
Now that the sample app is up and running on your local environment integrated with the Sentry SDK, you're ready to generate the first error.
To start using Sentry's error monitoring feature, you need some errors first. Let's add in an obvious error that will be easy to see in Sentry.
If you're using your own source code, skip this step. Instead, select your platform and follow its Verify step inside the Getting Started guide to introduce an error.
src/components/App.jsand uncomment line 97.
myCodeIsPerfect()isn't defined, so this will throw an error.
Save the file.
Refresh your browser and open the browser developer console.
The app is running in develop mode, so the change to your app should work after a refresh. You shouldn't see any errors in the console yet.
Click on any of the "Buy!"" buttons to add products to your shopping cart.
Click the "Checkout" button on the right panel to generate an error.
Now that you've triggered an error, let's see what it looks like in Sentry.
Open the Issues page in Sentry.io. Make sure yourprojectRepresents your service in Sentry and allows you to scope events to a distinct application.is selected in the projects dropdown.
Select the error from the issues list to to view the full details and context of this error.
Note that Sentry aggregates similar errors (events) into one Issue. If you trigger this error multiple times, you won't see more issues appear. Instead, you'll see the number of events for that issue increase.
On the Issue Details page, scroll down to the stack trace.
With a little configuration, Sentry can unminify your code back to its readable form and display your source code in each stack frame. You'll set this up in the next section.
The animated gif below walks through how to view error details in Sentry.
At this point, you've verified that Sentry is monitoring errors for your app. So you know there's an issue, but where do you go to fix it? In the next section, you'll learn how to Enable Readable Stack Traces in Your Errors so Sentry can show you exactly which line in which file is causing the issue.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").