Skip to content

Commit 89ede50

Browse files
Revise Getting Started section (#1513)
Not all platforms suggest "breaking your application", so move that sentence (reworded) to the platforms where it makes sense. Update how to send first event to current best-practice. Co-Authored-By: Tien "Mimi" Nguyen <[email protected]>
1 parent f7168a8 commit 89ede50

File tree

10 files changed

+44
-16
lines changed

10 files changed

+44
-16
lines changed
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
Import and initialize the Sentry SDK early in your application's setup:
22

33
```go
4-
import "github.com/getsentry/sentry-go"
4+
package main
5+
6+
import (
7+
"log"
8+
9+
"github.com/getsentry/sentry-go"
10+
)
511

612
func main() {
7-
sentry.Init(sentry.ClientOptions{
13+
err := sentry.Init(sentry.ClientOptions{
814
Dsn: "___PUBLIC_DSN___",
915
})
16+
if err != nil {
17+
log.Fatalf("sentry.Init: %s", err)
18+
}
1019
}
1120
```

src/collections/_documentation/error-reporting/getting-started-verify/browser.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
One way to break your JavaScript application is to call an undefined function:
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
3+
Calling an undefined function will throw an exception:
24

35
```js
46
myUndefinedFunction();

src/collections/_documentation/error-reporting/getting-started-verify/cordova.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
One way to break your Cordova application is to call an undefined function:
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
3+
Calling an undefined function will throw an exception:
24

35
```js
46
myUndefinedFunction();

src/collections/_documentation/error-reporting/getting-started-verify/electron.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
One way to break your Electron application is to call an undefined function:
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
3+
Calling an undefined function will throw an exception:
24

35
```js
46
myUndefinedFunction();
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
The quickest way to verify Sentry in your Go application is to capture an error:
1+
The quickest way to verify Sentry in your Go program is to capture a message:
22

33
```go
4+
package main
5+
46
import (
5-
"errors"
7+
"log"
68
"time"
9+
710
"github.com/getsentry/sentry-go"
811
)
912

1013
func main() {
11-
sentry.Init(sentry.ClientOptions{
14+
err := sentry.Init(sentry.ClientOptions{
1215
Dsn: "___PUBLIC_DSN___",
1316
})
17+
if err != nil {
18+
log.Fatalf("sentry.Init: %s", err)
19+
}
20+
// Flush buffered events before the program terminates.
21+
defer sentry.Flush(2 * time.Second)
1422

15-
sentry.CaptureException(errors.New("my error"))
16-
// Since sentry emits events in the background we need to make sure
17-
// they are sent before we shut down
18-
sentry.Flush(time.Second * 5)
23+
sentry.CaptureMessage("It works!")
1924
}
2025
```

src/collections/_documentation/error-reporting/getting-started-verify/node.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
One way to break your JavaScript application is to call an undefined function:
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
3+
Calling an undefined function will throw an exception:
24

35
```js
46
myUndefinedFunction();

src/collections/_documentation/error-reporting/getting-started-verify/php.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
You can trigger a PHP exception by throwing one in your application:
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
3+
You can throw an exception in your PHP application:
24

35
```php
46
throw new Exception("My first Sentry error!");

src/collections/_documentation/error-reporting/getting-started-verify/python.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
You can cause a Python error by inserting a divide by zero expression
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
3+
Raise an unhandled Python exception by inserting a divide by zero expression
24
into your application:
35

46
```py

src/collections/_documentation/error-reporting/getting-started-verify/rust.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
One way to verify your setup is by intentionally sending an event that breaks your application.
2+
13
The quickest way to verify Sentry in your Rust application is to cause a panic:
24

35
```rust

src/collections/_documentation/error-reporting/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ After you completed setting up a project in Sentry, you’ll be given a value wh
4141

4242
## Capturing your first event
4343

44-
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!
44+
Once you have Sentry integrated into your project, you probably want to verify that everything is working as expected before deploying it.
4545

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

0 commit comments

Comments
 (0)