Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Log uncaught exceptions (DEV) #2054

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Jan 7, 2021

Catch uncaught exceptions and log them before forwarding and crashing.
This allows our logging to capture those errors that crash the app, too.

Testing

  • Make the app crash and check that the stacktrace that took it down is present in the logfile when sharing it afterwards.

This allows our internal logging to capture those errors too.
@d4rken d4rken added enhancement Improvement of an existing feature maintainers Tag pull requests created by maintainers labels Jan 7, 2021
@d4rken d4rken added this to the 1.11.0 milestone Jan 7, 2021
@d4rken d4rken requested a review from a team January 7, 2021 15:23
@sonarcloud
Copy link

sonarcloud bot commented Jan 7, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

80.0% 80.0% Coverage
0.0% 0.0% Duplication

@ralfgehrer ralfgehrer self-assigned this Jan 8, 2021
Copy link
Contributor

@ralfgehrer ralfgehrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works nicely!

2021-01-09T09:11:00.204Z  E/main: Uncaught exception!
java.lang.NullPointerException: TEST EXCEPTION BY RALF
	at de.rki.coronawarnapp.ui.main.home.HomeFragment$onViewCreated$7.invoke(HomeFragment.kt:106)
	at de.rki.coronawarnapp.ui.main.home.HomeFragment$onViewCreated$7.invoke(HomeFragment.kt:35)
	at de.rki.coronawarnapp.util.ui.LiveDataExtensionsKt$observe2$1.onChanged(LiveDataExtensions.kt:9)
	at de.rki.coronawarnapp.util.ui.SingleLiveEvent$observe$1.onChanged(SingleLiveEvent.kt:53)
	at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
	at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
	at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
	at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
	at de.rki.coronawarnapp.util.ui.SingleLiveEvent.setValue(SingleLiveEvent.kt:61)
	at androidx.lifecycle.LiveData$1.run(LiveData.java:91)
	at android.os.Handler.handleCallback(Handler.java:883)
	at android.os.Handler.dispatchMessage(Handler.java:100)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7356)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

@chiljamgossow chiljamgossow self-assigned this Jan 8, 2021
@d4rken d4rken merged commit 4f69f52 into release/1.11.x Jan 8, 2021
@d4rken d4rken deleted the feature/DEV-log-uncaught-exceptions branch January 8, 2021 15:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Improvement of an existing feature maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants