Skip to content

Commit d25dbea

Browse files
authored
docs(unreal): Document FSentryDelegates::OnAssert in migration guide (#20927)
1 parent 8382ed7 commit d25dbea

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

‎docs/platforms/unreal/migration/index.mdx‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,37 @@ sidebar_section: configuration
99
We recommend using this guide starting from the version closes to your current version which might require scrolling further down before jumping to the latest guide.
1010
</Alert>
1111

12+
## Migrating to 2.0.0
13+
14+
### Breaking changes
15+
16+
#### Assert Handling
17+
18+
`FSentryOutputDevice` and `FSentryErrorOutputDevice` are no longer part of the public API. If you subscribed to the `OnAssert` delegate of `FSentryErrorOutputDevice`, use the static `FSentryDelegates::OnAssert` delegate instead:
19+
20+
```cpp
21+
// Handling failed assertions before v2.0.0
22+
23+
#include "SentryErrorOutputDevice.h"
24+
25+
FSentryErrorOutputDevice* SentryErrorDevice = static_cast<FSentryErrorOutputDevice*>(GError);
26+
SentryErrorDevice->OnAssert.AddLambda([](const FString& Message)
27+
{
28+
// Handle the assertion
29+
});
30+
31+
// Handling failed assertions in v2.0.0
32+
33+
#include "SentryDelegates.h"
34+
35+
FSentryDelegates::OnAssert.AddLambda([](const FString& Message)
36+
{
37+
// Handle the assertion
38+
});
39+
```
40+
41+
The delegate is called on the thread that hit the assertion, before the crash is reported. Your handler must be thread-safe and must not access UObjects.
42+
1243
## Migrating to 1.0.0
1344

1445
### Breaking changes

0 commit comments

Comments
 (0)