-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Revise Getting Started section #1513
Conversation
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*.
sentry.Init(sentry.ClientOptions{ | ||
err := sentry.Init(sentry.ClientOptions{ |
There was a problem hiding this comment.
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.
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!") |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
src/collections/_documentation/error-reporting/getting-started-verify/browser.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
There was a problem hiding this 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: 😸
src/collections/_documentation/error-reporting/getting-started-verify/browser.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/browser.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/cordova.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/cordova.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/csharp.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/node.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/node.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/php.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/python.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/rust.md
Outdated
Show resolved
Hide resolved
src/collections/_documentation/error-reporting/getting-started-verify/csharp.md
Outdated
Show resolved
Hide resolved
Co-Authored-By: Tien "Mimi" Nguyen <[email protected]>
@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 @MimiDumpling would you like to have a final look? |
Your suggestion to replace it with "throw an exception" is perfect. Thank you! |
Specific changes to the Go SDK and general changes to all platforms.