diff --git a/docs/platforms/godot/configuration/options.mdx b/docs/platforms/godot/configuration/options.mdx index 1bee255f380c18..337b06942249ca 100644 --- a/docs/platforms/godot/configuration/options.mdx +++ b/docs/platforms/godot/configuration/options.mdx @@ -127,7 +127,7 @@ Specifies the types of errors captured as breadcrumbs. Accepts a single value or - `MASK_SCRIPT`: Script errors will be captured. - `MASK_SHADER`: Shader errors will be captured. -```gdscript +```GDScript var mask = SentryOptions.MASK_ERROR | SentryOptions.MASK_SCRIPT options.logger_breadcrumb_mask = mask ``` @@ -138,7 +138,7 @@ options.logger_breadcrumb_mask = mask Specifies the types of errors captured as events. Accepts a single value or a bitwise combination of `GodotErrorMask` masks. -```gdscript +```GDScript var mask = SentryOptions.MASK_ERROR | SentryOptions.MASK_SCRIPT options.logger_event_mask = mask ``` @@ -178,7 +178,7 @@ thread-safe APIs and only use Godot-specific APIs after you've checked that you' 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. -```gdscript +```GDScript func _before_send(event: SentryEvent) -> SentryEvent: if event.environment.contains("editor"): # Discard event if running from the editor. @@ -191,19 +191,15 @@ func _before_send(event: SentryEvent) -> SentryEvent: - + -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). +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. -```gdscript -func _on_crash(event: SentryEvent) -> SentryEvent: - if event.environment.contains("editor"): - # Discard event if running from the editor. - return null - if event.message.contains("Bruno"): - # Remove sensitive information from the event. - event.message = event.message.replace("Bruno", "REDACTED") - return event +```GDScript +func _before_capture_screenshot(event: SentryEvent) -> bool: + if is_showing_sensitive_info(): + return false # Don't capture screenshot! + return true ``` diff --git a/docs/platforms/godot/configuration/stack-traces.mdx b/docs/platforms/godot/configuration/stack-traces.mdx index 8c32f149319306..c23d84acc78b1e 100644 --- a/docs/platforms/godot/configuration/stack-traces.mdx +++ b/docs/platforms/godot/configuration/stack-traces.mdx @@ -214,7 +214,7 @@ For more information, refer to [Sentry CLI](/cli/) documentation. You can also upload debug files for the Sentry SDK itself by running the following command from your project directory: ```bash {tabTitle:Bash/PowerShell} -sentry-cli debug-files upload --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ addons/sentrysdk/ +sentry-cli debug-files upload --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ addons/sentry/ ``` This uploads the SDK's debug files to Sentry. You can repeat this step for any other native extension used in your Godot project. diff --git a/platform-includes/capture-message/godot.mdx b/platform-includes/capture-message/godot.mdx index f629a9844f2588..95daee23a7367c 100644 --- a/platform-includes/capture-message/godot.mdx +++ b/platform-includes/capture-message/godot.mdx @@ -1,3 +1,3 @@ -```gdscript +```GDScript SentrySDK.capture_message("Something went wrong") ``` diff --git a/platform-includes/configuration/before-send/godot.mdx b/platform-includes/configuration/before-send/godot.mdx index 95a377e59096f6..234c4de0e70da0 100644 --- a/platform-includes/configuration/before-send/godot.mdx +++ b/platform-includes/configuration/before-send/godot.mdx @@ -1,12 +1,11 @@ -```gdscript +```GDScript extends SentryConfiguration ## Tip: Assign configuration script in the Project Settings. func _configure(options: SentryOptions): - options.before_send = _process_event - options.on_crash = _process_event + options.before_send = _before_send -func _process_event(event: SentryEvent) -> SentryEvent: +func _before_send(event: SentryEvent) -> SentryEvent: if event.environment == "debug": # Discard event if running in a debug build. return null diff --git a/platform-includes/configuration/config-intro/godot.mdx b/platform-includes/configuration/config-intro/godot.mdx index 58b181949b737f..0c3a707d518ecb 100644 --- a/platform-includes/configuration/config-intro/godot.mdx +++ b/platform-includes/configuration/config-intro/godot.mdx @@ -4,7 +4,7 @@ Options are used to initialize and control the behavior of the SDK. They can be 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. -```gdscript +```GDScript extends SentryConfiguration func _configure(options: SentryOptions): @@ -12,10 +12,9 @@ func _configure(options: SentryOptions): options.environment = "debug" options.debug = true options.release = "mygame@1.0.0" - options.before_send = _process_event - options.on_crash = _process_event + options.before_send = _before_send -func _process_event(event: SentryEvent) -> SentryEvent: +func _before_send(event: SentryEvent) -> SentryEvent: if event.environment == "debug": # Discard event if running in a debug build. return null diff --git a/platform-includes/configuration/sample-rate/godot.mdx b/platform-includes/configuration/sample-rate/godot.mdx index cb5a1cfcf37902..8fc1076f41caf7 100644 --- a/platform-includes/configuration/sample-rate/godot.mdx +++ b/platform-includes/configuration/sample-rate/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript extends SentryConfiguration ## Tip: Assign configuration script in the Project Settings. diff --git a/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/godot.mdx b/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/godot.mdx index a794c88d29b405..a474b87e62c7eb 100644 --- a/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/godot.mdx +++ b/platform-includes/enriching-events/breadcrumbs/breadcrumbs-example/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript var message := "Player respawned" var category := "gameplay" var level := SentrySDK.LEVEL_INFO diff --git a/platform-includes/enriching-events/set-context/godot.mdx b/platform-includes/enriching-events/set-context/godot.mdx index 0cc12b11bfed79..98b06774799e20 100644 --- a/platform-includes/enriching-events/set-context/godot.mdx +++ b/platform-includes/enriching-events/set-context/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript SentrySDK.set_context( "ship", { diff --git a/platform-includes/enriching-events/set-tag/godot.mdx b/platform-includes/enriching-events/set-tag/godot.mdx index 1244f9f50423dc..76449be51b8591 100644 --- a/platform-includes/enriching-events/set-tag/godot.mdx +++ b/platform-includes/enriching-events/set-tag/godot.mdx @@ -1,3 +1,3 @@ -```gdscript +```GDScript SentrySDK.set_tag("biome", "jungle"); ``` diff --git a/platform-includes/enriching-events/set-user/godot.mdx b/platform-includes/enriching-events/set-user/godot.mdx index 582ebb0ccfff59..0062cb31b936ce 100644 --- a/platform-includes/enriching-events/set-user/godot.mdx +++ b/platform-includes/enriching-events/set-user/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript var user := SentryUser.new() user.generate_new_id() user.infer_ip_address() diff --git a/platform-includes/enriching-events/unset-user/godot.mdx b/platform-includes/enriching-events/unset-user/godot.mdx index deea3529fa7fb1..6cbcbfb3b6c8aa 100644 --- a/platform-includes/enriching-events/unset-user/godot.mdx +++ b/platform-includes/enriching-events/unset-user/godot.mdx @@ -1,3 +1,3 @@ -```gdscript +```GDScript SentrySDK.remove_user() ``` diff --git a/platform-includes/getting-started-install/godot.mdx b/platform-includes/getting-started-install/godot.mdx index 510eed453b1c7f..da174a3121cb53 100644 --- a/platform-includes/getting-started-install/godot.mdx +++ b/platform-includes/getting-started-install/godot.mdx @@ -1,7 +1,7 @@ -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. +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. -Ensure that the addon is placed exactly as it is in the demo project, in the `addons/sentrysdk` folder, preserving the exact casing. +Ensure that the addon is placed exactly as it is in the demo project, in the `addons/sentry` folder, preserving the exact casing. diff --git a/platform-includes/getting-started-primer/godot.mdx b/platform-includes/getting-started-primer/godot.mdx index 1d75dc80cb1512..532c19bfaca550 100644 --- a/platform-includes/getting-started-primer/godot.mdx +++ b/platform-includes/getting-started-primer/godot.mdx @@ -7,7 +7,7 @@ Our SDK for Godot Engine builds on top of existing Sentry SDKs, extending them w - Capture Godot errors, such as script and shader error - Adding surrounding script source code if available - Throttling options for spammy errors -- Filter and customize events in `before_send` and `on_crash` callbacks (in GDScript) +- Filter and customize events in `before_send` callback (in GDScript) - Attachment support for Godot logs - Information about user configuration like GPU, CPU, platform and such - Configure options in Project Settings and/or in GDScript diff --git a/platform-includes/getting-started-verify/godot.mdx b/platform-includes/getting-started-verify/godot.mdx index b5fefc169382e8..3ac18c093565bf 100644 --- a/platform-includes/getting-started-verify/godot.mdx +++ b/platform-includes/getting-started-verify/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript extends Node func _ready(): diff --git a/platform-includes/sensitive-data/set-tag/godot.mdx b/platform-includes/sensitive-data/set-tag/godot.mdx index 12cd0fbfb0f9e4..72dabf4d15c200 100644 --- a/platform-includes/sensitive-data/set-tag/godot.mdx +++ b/platform-includes/sensitive-data/set-tag/godot.mdx @@ -1,3 +1,3 @@ -```gdscript +```GDScript SentrySDK.set_tag("birthday", str("08/12/1990".hash())) ``` diff --git a/platform-includes/sensitive-data/set-user/godot.mdx b/platform-includes/sensitive-data/set-user/godot.mdx index 90d039cdb9a5fc..89024c47c30954 100644 --- a/platform-includes/sensitive-data/set-user/godot.mdx +++ b/platform-includes/sensitive-data/set-user/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript # Assuming client_user is an Object containing user data. var user := SentryUser.new() user.id = client_user.id diff --git a/platform-includes/set-environment/godot.mdx b/platform-includes/set-environment/godot.mdx index eda14c50ca8f26..f9ef49a16b578b 100644 --- a/platform-includes/set-environment/godot.mdx +++ b/platform-includes/set-environment/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript extends SentryConfiguration ## Tip: Assign configuration script in the Project Settings. diff --git a/platform-includes/set-level/godot.mdx b/platform-includes/set-level/godot.mdx index 6bee8a72e9d5ea..6810847fdd20b5 100644 --- a/platform-includes/set-level/godot.mdx +++ b/platform-includes/set-level/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript var event = SentrySDK.create_event() event.level = SentrySDK.LEVEL_WARNING SentrySDK.capture_event(event) diff --git a/platform-includes/set-release/godot.mdx b/platform-includes/set-release/godot.mdx index f139ca387cbeb3..f10dc733f0a6fa 100644 --- a/platform-includes/set-release/godot.mdx +++ b/platform-includes/set-release/godot.mdx @@ -1,4 +1,4 @@ -```gdscript +```GDScript extends SentryConfiguration ## Tip: Assign configuration script in the Project Settings.