Skip to content

feat(quickstart): Add examples for all quickstart platforms #1026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See the [provided examples in the `dotnet` SDK repository](https://github.com/getsentry/sentry-dotnet/tree/master/samples) for examples to send your first event to Sentry.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
One way to break your JavaScript application is to call an undefined function:

```js
myUndefinedFunction();
```

You can verify the function caused an error by checking your browser console.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% include_relative getting-started-verify/browser.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
One way to break your Cordova application is to call an undefined function:

```js
myUndefinedFunction();
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
You can verify Sentry is capturing unhandled exceptions by raising an exception. For example, you can use the following snippet to raise a `DivideByZeroException`:

```csharp
using (SentrySdk.Init("___PUBLIC_DSN___"))
{
Console.WriteLine(1 / 0);
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
One way to break your Electron application is to call an undefined function:

```js
myUndefinedFunction();
```

You may want to try inserting this into both your `main` and any `renderer`
processes to verify Sentry is operational in both.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
One way to break your JavaScript application is to call an undefined function:

```js
myUndefinedFunction();
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
You can trigger a PHP exception by throwing one in your application:

```php
throw new Exception("My first Sentry error!");
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
You can cause a Python error by inserting a divide by zero expression
into your application:

```py
division_by_zero = 1 / 0
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The quickest way to verify Sentry in your Rust application is to cause a panic:

```rust
fn main() {
// Initialize sentry here

sentry::integrations::panic::register_panic_handler();

// Sentry will capture this
panic!("Everything is on fire!");
}
```
10 changes: 9 additions & 1 deletion src/collections/_documentation/error-reporting/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,17 @@ Note: If you’re using Heroku, and you’ve added Hosted Sentry via the standar
content=__alert_content
%}

## Capturing your first event

Once you have Sentry integrated into your project, you probably want to verify that everything is working as expected before deploying it, and what better way to do that than to break your application!

{% wizard %}
{% include components/platform_content.html content_dir='getting-started-verify' %}
{% endwizard %}

## Next Steps

Now that you’ve got basic reporting setup, you’ll want to explore adding additional context to your data.
Now that you’ve got basic reporting set up, you’ll want to explore adding additional context to your data.

{% include components/platform_content.html content_dir='getting-started-next-steps' %}
- [_manual error and event capturing_]({%- link _documentation/error-reporting/capturing.md -%})
Expand Down