Replies: 3 comments
-
If you add unhandled exception, does this exception goes to this unhandled exception handler, or it also crashes the app? |
Beta Was this translation helpful? Give feedback.
-
Could you post some more details about the exact crash you're seeing. For NullReferenceException he runtime relies on handling SIGSEGV (we have registered a signal handler), if something else registers signal handler and doesn't call back to our handler this won't work. This only applies to NullReferenceException, other exceptions should always work. Some crash reporting frameworks sometimes handle signals and don't chain to our handler which might cause this. |
Beta Was this translation helpful? Give feedback.
-
Logs from Sentry:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
we're facing an issue that we don't fully understand- this specific piece of code causes a crash only on Android in production..
Code:
`
public async Task SearchAsync()
{
IsLoading = true;
//here was the problem: result.Payload can be NULL
`
As you can see, there is an obvious issue: result.Payload can be null in some cases. However, what we don’t understand is why this code crashes in production, even though it’s wrapped in a try/catch block.
In DEBUG mode, the exception is caught correctly on both iOS and Android.
In Production:
On iOS, the exception is properly caught and there is no crash.
On Android, however, we experience a crash.
Why is this happening? Does it mean we need to be extremely cautious and explicitly handle every potential null or edge case, even when using try/catch?
The real concern for us is that this code is simple and contains an obvious bug, but we’re seeing many other strange crashes reported in Sentry, where the cause is completely unclear. For example, when using third-party libraries, the method is inside a try block, but the exception still isn’t handled properly — which is very problematic. Or maybe we’re misunderstanding how exception handling should work in these cases?
We’re looking for any advice or insights.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions