Skip to content

Revise Getting Started section #1513

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 4 commits into from
Mar 2, 2020

Conversation

rhcarvalho
Copy link
Contributor

Specific changes to the Go SDK and general changes to all platforms.

All platforms:

Not all platforms suggest "breaking your application", so move that
sentence to the platforms where it makes sense.

Go-specific:

Sending a message is slightly simpler than an error.

Also add error handling and defer call to Flush -- this is a better
pattern that doesn't induce people to think they need to call Flush
after every call to Capture*.
Comment on lines -7 to +13
sentry.Init(sentry.ClientOptions{
err := sentry.Init(sentry.ClientOptions{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds error handling here. It is easy enough to ignore the error and end up with a misconfigured SDK without warning.

Although this makes the documentation more verbose, this is also where people will refer to. Better have the full picture when copy-pasting.

Comment on lines +21 to +23
defer sentry.Flush(2 * time.Second)

sentry.CaptureException(errors.New("my error"))
// Since sentry emits events in the background we need to make sure
// they are sent before we shut down
sentry.Flush(time.Second * 5)
sentry.CaptureMessage("It works!")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For testing purposes, a message is simpler to setup than an error.

Prefer educating users to use defer sentry.Flush(...) instead of calling Flush after CaptureException.
People got the wrong impression that they need to call the two functions in sequence all the time.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all platforms suggest "breaking your application", therefore move this sentence to where it is appropriate, and leave it out elsewhere.

@rhcarvalho rhcarvalho marked this pull request as ready for review February 25, 2020 21:50
Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the hardest work ever!

Avoid repeating "break your application".

s/break your \w+ application/do it
Copy link
Contributor

@MimiDumpling MimiDumpling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few suggestions: 😸

Co-Authored-By: Tien "Mimi" Nguyen <[email protected]>
@rhcarvalho
Copy link
Contributor Author

@MimiDumpling thank you very much for your suggestions! I applied them all with one modification:

- Calling an undefined function will trigger a break:
+ Calling an undefined function will throw an exception:

Because break is a keyword related to a different concept, and in this case "trigger a break" sounds weird.


@MimiDumpling would you like to have a final look?

@MimiDumpling
Copy link
Contributor

@MimiDumpling thank you very much for your suggestions! I applied them all with one modification:

- Calling an undefined function will trigger a break:
+ Calling an undefined function will throw an exception:

Because break is a keyword related to a different concept, and in this case "trigger a break" sounds weird.

@MimiDumpling would you like to have a final look?

Your suggestion to replace it with "throw an exception" is perfect. Thank you!

@rhcarvalho rhcarvalho merged commit 89ede50 into getsentry:master Mar 2, 2020
@rhcarvalho rhcarvalho deleted the go-quickstart-reloaded branch March 2, 2020 14:06
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants