diff --git a/docs/platforms/godot/configuration/options.mdx b/docs/platforms/godot/configuration/options.mdx index c14740cc651db9..8fb3f3baddc11e 100644 --- a/docs/platforms/godot/configuration/options.mdx +++ b/docs/platforms/godot/configuration/options.mdx @@ -246,9 +246,11 @@ func _before_send(event: SentryEvent) -> SentryEvent: if event.environment.contains("editor"): # Discard event if running from the editor. return null - if event.message.contains("Bruno"): + var error_message: String = event.get_exception_value(0) + if error_message.contains("Bruno"): # Remove sensitive information from the event. - event.message = event.message.replace("Bruno", "REDACTED") + var redacted_message := error_message.replace("Bruno", "REDACTED") + event.set_exception_value(0, redacted_message) return event ``` diff --git a/platform-includes/configuration/before-send/godot.mdx b/platform-includes/configuration/before-send/godot.mdx index 9663ac8378dfcb..66c1c60425c503 100644 --- a/platform-includes/configuration/before-send/godot.mdx +++ b/platform-includes/configuration/before-send/godot.mdx @@ -10,11 +10,13 @@ func _initialize() -> void: ) func _before_send(event: SentryEvent) -> SentryEvent: - if event.environment == "debug": - # Discard event if running in a debug build. + if event.environment.contains("editor"): + # Discard event if running from the editor. return null - if event.message.contains("Bruno"): + var error_message: String = event.get_exception_value(0) + if error_message.contains("Bruno"): # Remove sensitive information from the event. - event.message = event.message.replace("Bruno", "REDACTED") + var redacted_message := error_message.replace("Bruno", "REDACTED") + event.set_exception_value(0, redacted_message) return event ``` diff --git a/platform-includes/configuration/config-intro/godot.mdx b/platform-includes/configuration/config-intro/godot.mdx index b98da30d887fd0..e9c33d112bdf21 100644 --- a/platform-includes/configuration/config-intro/godot.mdx +++ b/platform-includes/configuration/config-intro/godot.mdx @@ -35,12 +35,14 @@ func _initialize() -> void: ) func _before_send(event: SentryEvent) -> SentryEvent: - if event.environment == "debug": - # Discard event if running in a debug build. + if event.environment.contains("editor"): + # Discard event if running from the editor. return null - if event.message.contains("Bruno"): - # Scrub sensitive information from the event. - event.message = event.message.replace("Bruno", "REDACTED") + var error_message: String = event.get_exception_value(0) + if error_message.contains("Bruno"): + # Remove sensitive information from the event. + var redacted_message := error_message.replace("Bruno", "REDACTED") + event.set_exception_value(0, redacted_message) return event ```