-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API allowing to check if captured event is ANR error #581
Conversation
|
@@ -54,3 +54,8 @@ bool SentryEventAndroid::IsCrash() const | |||
{ | |||
return CallMethod<bool>(IsCrashMethod); | |||
} | |||
|
|||
bool SentryEventAndroid::IsAppNotResponding() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool SentryEventAndroid::IsAppNotResponding() const | |
bool SentryEventAndroid::IsAnr() const |
We're using the abbrevation everywhere else.
@@ -19,6 +19,7 @@ class SentryEventAndroid : public ISentryEvent, public FSentryJavaObjectWrapper | |||
virtual void SetLevel(ESentryLevel level) override; | |||
virtual ESentryLevel GetLevel() const override; | |||
virtual bool IsCrash() const override; | |||
virtual bool IsAppNotResponding() const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual bool IsAppNotResponding() const override; | |
virtual bool IsAnr() const override; |
@@ -54,3 +54,21 @@ bool SentryEventApple::IsCrash() const | |||
{ | |||
return EventApple.error != nullptr; | |||
} | |||
|
|||
bool SentryEventApple::IsAppNotResponding() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool SentryEventApple::IsAppNotResponding() const | |
bool SentryEventApple::IsAnr() const |
@@ -20,6 +20,7 @@ class SentryEventApple : public ISentryEvent | |||
virtual void SetLevel(ESentryLevel level) override; | |||
virtual ESentryLevel GetLevel() const override; | |||
virtual bool IsCrash() const override; | |||
virtual bool IsAppNotResponding() const override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual bool IsAppNotResponding() const override; | |
virtual bool IsAnr() const override; |
@@ -60,4 +60,10 @@ bool SentryEventDesktop::IsCrash() const | |||
return IsCrashEvent; | |||
} | |||
|
|||
bool SentryEventDesktop::IsAppNotResponding() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool SentryEventDesktop::IsAppNotResponding() const | |
bool SentryEventDesktop::IsAnr() const |
@@ -16,4 +16,5 @@ class ISentryEvent | |||
virtual void SetLevel(ESentryLevel level) = 0; | |||
virtual ESentryLevel GetLevel() const = 0; | |||
virtual bool IsCrash() const = 0; | |||
virtual bool IsAppNotResponding() const = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual bool IsAppNotResponding() const = 0; | |
virtual bool IsAnr() const = 0; |
@@ -80,6 +80,14 @@ bool USentryEvent::IsCrash() const | |||
return EventNativeImpl->IsCrash(); | |||
} | |||
|
|||
bool USentryEvent::IsAppNotResponding() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool USentryEvent::IsAppNotResponding() const | |
bool USentryEvent::IsAnr() const |
if(!EventNativeImpl) | ||
return false; | ||
|
||
return EventNativeImpl->IsAppNotResponding(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return EventNativeImpl->IsAppNotResponding(); | |
return EventNativeImpl->IsAnr(); |
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
### Features | |||
|
|||
- Add API allowing to check if captured event is ANR error ([#581](https://github.com/getsentry/sentry-unreal/pull/581)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Add API allowing to check if captured event is ANR error ([#581](https://github.com/getsentry/sentry-unreal/pull/581)) | |
- Added `IsAnr()` method to mobile `SentryEvents` to check if the event is caused by the Application Not Responding ([#581](https://github.com/getsentry/sentry-unreal/pull/581)) |
@@ -48,6 +48,10 @@ class SENTRY_API USentryEvent : public UObject | |||
UFUNCTION(BlueprintPure, Category = "Sentry") | |||
bool IsCrash() const; | |||
|
|||
/** Gets flag indicating whether the event is an Application Not Responding (ANR) error. */ | |||
UFUNCTION(BlueprintPure, Category = "Sentry") | |||
bool IsAppNotResponding() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's nice having it written out in the blueprints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add a meta=(DisplayName="Is App Not Responding")
attribute for UFUNCTION here in order to display the full name in blueprints while still having IsAnr
in C++ as everywhere else. Does that sound good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be great!
This PR adds a new method to
USentryEvent
which allows checking if the captured event is an ANR error. By default, ANR error tracking is turned off in plugin settings.Note, that ANR error tracking works only on Android/Apple since
sentry-native
doesn't support it at the moment.Closes #574