Skip to content

Commit 0b5f10e

Browse files
committed
Add class reference
1 parent fc0c019 commit 0b5f10e

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

doc_classes/SentryAttachment.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<class name="SentryAttachment" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
3+
<brief_description>
4+
Represents a file attachment that can be sent with Sentry events.
5+
</brief_description>
6+
<description>
7+
SentryAttachment represents a file that can be attached to Sentry events to provide additional context. Attachments are files that are uploaded alongside error reports and can include log files, screenshots, configuration files, or any other relevant data.
8+
Attachments should be created using [method SentryAttachment.create_with_path], then added to Sentry using [method SentrySDK.add_attachment] and can be removed using [method SentrySDK.remove_attachment].
9+
To learn more about attachments, visit [url=https://docs.sentry.io/platforms/godot/enriching-events/attachments/]Attachments documentation[/url].
10+
</description>
11+
<tutorials>
12+
</tutorials>
13+
<methods>
14+
<method name="create_with_path" qualifiers="static">
15+
<return type="SentryAttachment" />
16+
<param index="0" name="path" type="String" />
17+
<param index="1" name="content_type" type="String" default="&quot;&quot;" />
18+
<description>
19+
Creates a new [SentryAttachment] with the specified file [param path] and optional [param content_type]. The [param path] should point to an existing file and supports Godot's virtual file system paths like "user://" and "res://". The optional [param content_type] parameter specifies the MIME type of the file (e.g., "text/plain", "application/json").
20+
[b]Important:[/b] Attachments are read lazily at the time an event is sent to Sentry.
21+
</description>
22+
</method>
23+
</methods>
24+
<members>
25+
<member name="content_type" type="String" setter="set_content_type" getter="get_content_type" default="&quot;&quot;">
26+
The MIME content type of the attachment file. This helps Sentry understand how to handle and display the attachment.
27+
</member>
28+
<member name="file_path" type="String" setter="set_file_path" getter="get_file_path" default="&quot;&quot;">
29+
The file path of the attachment. This can be an absolute path or use Godot's virtual file system paths such as "user://" or "res://".
30+
</member>
31+
</members>
32+
</class>

doc_classes/SentrySDK.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
<tutorials>
1414
</tutorials>
1515
<methods>
16+
<method name="add_attachment">
17+
<return type="void" />
18+
<param index="0" name="attachment" type="SentryAttachment" />
19+
<description>
20+
Attaches a file to future Sentry events. The [param attachment] should be a [SentryAttachment] object created with [method SentryAttachment.create_with_path]. Supports Godot's virtual file system paths like "user://" and "res://".
21+
To learn more, visit [url=https://docs.sentry.io/platforms/godot/enriching-events/attachments/]Attachments documentation[/url].
22+
</description>
23+
</method>
1624
<method name="add_breadcrumb">
1725
<return type="void" />
1826
<param index="0" name="message" type="String" />
@@ -64,6 +72,13 @@
6472
Returns whether the SDK is enabled, i.e. whether it is initialized and active.
6573
</description>
6674
</method>
75+
<method name="remove_attachment">
76+
<return type="void" />
77+
<param index="0" name="attachment" type="SentryAttachment" />
78+
<description>
79+
Removes a previously added attachment from future Sentry events. The [param attachment] should be a [SentryAttachment] object returned by [method SentrySDK.add_attachment].
80+
</description>
81+
</method>
6782
<method name="remove_tag">
6883
<return type="void" />
6984
<param index="0" name="key" type="String" />

0 commit comments

Comments
 (0)