Skip to content

Commit 2808db9

Browse files
authored
Godot: Synchronize documentation with latest changes (#13824)
1 parent 5c3a8a4 commit 2808db9

File tree

19 files changed

+33
-39
lines changed

19 files changed

+33
-39
lines changed

docs/platforms/godot/configuration/options.mdx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Specifies the types of errors captured as breadcrumbs. Accepts a single value or
127127
- `MASK_SCRIPT`: Script errors will be captured.
128128
- `MASK_SHADER`: Shader errors will be captured.
129129

130-
```gdscript
130+
```GDScript
131131
var mask = SentryOptions.MASK_ERROR | SentryOptions.MASK_SCRIPT
132132
options.logger_breadcrumb_mask = mask
133133
```
@@ -138,7 +138,7 @@ options.logger_breadcrumb_mask = mask
138138

139139
Specifies the types of errors captured as events. Accepts a single value or a bitwise combination of `GodotErrorMask` masks.
140140

141-
```gdscript
141+
```GDScript
142142
var mask = SentryOptions.MASK_ERROR | SentryOptions.MASK_SCRIPT
143143
options.logger_event_mask = mask
144144
```
@@ -178,7 +178,7 @@ thread-safe APIs and only use Godot-specific APIs after you've checked that you'
178178

179179
If assigned, this callback runs before a message or error event is sent to Sentry. It takes `SentryEvent` as a parameter and returns either the same event object, with or without modifications, or `null` to skip reporting the event. You can assign it in a [configuration script](#configuration-script). This can be used, for instance, for stripping PII before sending.
180180

181-
```gdscript
181+
```GDScript
182182
func _before_send(event: SentryEvent) -> SentryEvent:
183183
if event.environment.contains("editor"):
184184
# Discard event if running from the editor.
@@ -191,19 +191,15 @@ func _before_send(event: SentryEvent) -> SentryEvent:
191191

192192
</ConfigKey>
193193

194-
<ConfigKey name="on-crash">
194+
<ConfigKey name="before-capture-screenshot">
195195

196-
If assigned, this callback runs before a crash event is sent to Sentry. In contrast to `before_send`, it is only called when a crash occurred. It takes `SentryEvent` as a parameter and returns either the same event object, with or without modifications, or `null` to skip reporting the event. You can assign it in a [configuration script](#configuration-script).
196+
If assigned, this callback runs before a screenshot is captured. It takes `SentryEvent` as a parameter and returns `false` to skip capturing the screenshot, or `true` to capture the screenshot.
197197

198-
```gdscript
199-
func _on_crash(event: SentryEvent) -> SentryEvent:
200-
if event.environment.contains("editor"):
201-
# Discard event if running from the editor.
202-
return null
203-
if event.message.contains("Bruno"):
204-
# Remove sensitive information from the event.
205-
event.message = event.message.replace("Bruno", "REDACTED")
206-
return event
198+
```GDScript
199+
func _before_capture_screenshot(event: SentryEvent) -> bool:
200+
if is_showing_sensitive_info():
201+
return false # Don't capture screenshot!
202+
return true
207203
```
208204

209205
</ConfigKey>

docs/platforms/godot/configuration/stack-traces.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ For more information, refer to [Sentry CLI](/cli/) documentation.
214214
You can also upload debug files for the Sentry SDK itself by running the following command from your project directory:
215215

216216
```bash {tabTitle:Bash/PowerShell}
217-
sentry-cli debug-files upload --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ addons/sentrysdk/
217+
sentry-cli debug-files upload --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ addons/sentry/
218218
```
219219

220220
This uploads the SDK's debug files to Sentry. You can repeat this step for any other native extension used in your Godot project.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```gdscript
1+
```GDScript
22
SentrySDK.capture_message("Something went wrong")
33
```

platform-includes/configuration/before-send/godot.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
```gdscript
1+
```GDScript
22
extends SentryConfiguration
33
## Tip: Assign configuration script in the Project Settings.
44
55
func _configure(options: SentryOptions):
6-
options.before_send = _process_event
7-
options.on_crash = _process_event
6+
options.before_send = _before_send
87
9-
func _process_event(event: SentryEvent) -> SentryEvent:
8+
func _before_send(event: SentryEvent) -> SentryEvent:
109
if event.environment == "debug":
1110
# Discard event if running in a debug build.
1211
return null

platform-includes/configuration/config-intro/godot.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ Options are used to initialize and control the behavior of the SDK. They can be
44

55
To define a configuration script, create a new script that extends the `SentryConfiguration` class. Then, assign your configuration script in the **Project Settings** under the **Sentry** category in the `Configuration Script` field.
66

7-
```gdscript
7+
```GDScript
88
extends SentryConfiguration
99
1010
func _configure(options: SentryOptions):
1111
if OS.is_debug_build():
1212
options.environment = "debug"
1313
options.debug = true
1414
options.release = "mygame@1.0.0"
15-
options.before_send = _process_event
16-
options.on_crash = _process_event
15+
options.before_send = _before_send
1716
18-
func _process_event(event: SentryEvent) -> SentryEvent:
17+
func _before_send(event: SentryEvent) -> SentryEvent:
1918
if event.environment == "debug":
2019
# Discard event if running in a debug build.
2120
return null

platform-includes/configuration/sample-rate/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
extends SentryConfiguration
33
## Tip: Assign configuration script in the Project Settings.
44

platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
var message := "Player respawned"
33
var category := "gameplay"
44
var level := SentrySDK.LEVEL_INFO

platform-includes/enriching-events/set-context/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
SentrySDK.set_context(
33
"ship",
44
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```gdscript
1+
```GDScript
22
SentrySDK.set_tag("biome", "jungle");
33
```

platform-includes/enriching-events/set-user/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
var user := SentryUser.new()
33
user.generate_new_id()
44
user.infer_ip_address()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```gdscript
1+
```GDScript
22
SentrySDK.remove_user()
33
```
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Download the latest stable version `{{@inject packages.version('sentry.godot', '?') }}` from [GitHub Releases](https://github.com/getsentry/sentry-godot/releases/). The archive includes the Sentry SDK addon and a demo project. You can either extract the entire archive into a separate folder to open the demo in Godot Engine or extract only `addons/sentrysdk` into existing project.
1+
Download the latest stable version `{{@inject packages.version('sentry.godot', '?') }}` from [GitHub Releases](https://github.com/getsentry/sentry-godot/releases/). The archive includes the Sentry SDK addon and a demo project. You can either extract the entire archive into a separate folder to open the demo in Godot Engine or extract only `addons/sentry` into existing project.
22

33
<Alert>
44

5-
Ensure that the addon is placed exactly as it is in the demo project, in the `addons/sentrysdk` folder, preserving the exact casing.
5+
Ensure that the addon is placed exactly as it is in the demo project, in the `addons/sentry` folder, preserving the exact casing.
66

77
</Alert>

platform-includes/getting-started-primer/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Our SDK for Godot Engine builds on top of existing Sentry SDKs, extending them w
77
- Capture Godot errors, such as script and shader error
88
- Adding surrounding script source code if available
99
- Throttling options for spammy errors
10-
- Filter and customize events in `before_send` and `on_crash` callbacks (in GDScript)
10+
- Filter and customize events in `before_send` callback (in GDScript)
1111
- Attachment support for Godot logs
1212
- Information about user configuration like GPU, CPU, platform and such
1313
- Configure options in Project Settings and/or in GDScript

platform-includes/getting-started-verify/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
extends Node
33
44
func _ready():
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```gdscript
1+
```GDScript
22
SentrySDK.set_tag("birthday", str("08/12/1990".hash()))
33
```

platform-includes/sensitive-data/set-user/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
# Assuming client_user is an Object containing user data.
33
var user := SentryUser.new()
44
user.id = client_user.id

platform-includes/set-environment/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
extends SentryConfiguration
33
## Tip: Assign configuration script in the Project Settings.
44

platform-includes/set-level/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
var event = SentrySDK.create_event()
33
event.level = SentrySDK.LEVEL_WARNING
44
SentrySDK.capture_event(event)

platform-includes/set-release/godot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```gdscript
1+
```GDScript
22
extends SentryConfiguration
33
## Tip: Assign configuration script in the Project Settings.
44

0 commit comments

Comments
 (0)