From 4ad841d525a28b780cbc49452cf283e9a68a7a9f Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Wed, 20 Feb 2019 17:12:41 -0600 Subject: [PATCH] Correctly handle error gracefully in the RxBus that receives information from the Node through graphenej, to avoid a crash. --- .../bitsybitshareswallet/fragments/ConnectedFragment.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ConnectedFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ConnectedFragment.kt index 65e4e92..a1c5346 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ConnectedFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/ConnectedFragment.kt @@ -9,6 +9,7 @@ import android.os.IBinder import android.util.Log import android.view.View import androidx.fragment.app.Fragment +import com.crashlytics.android.Crashlytics import cy.agorise.graphenej.api.ConnectionStatusUpdate import cy.agorise.graphenej.api.android.NetworkService import cy.agorise.graphenej.api.android.RxBus @@ -43,7 +44,10 @@ abstract class ConnectedFragment : Fragment(), ServiceConnection { RxBus.getBusInstance() .asFlowable() .observeOn(AndroidSchedulers.mainThread()) - .subscribe { handleIncomingMessage(it) } + .subscribe( + { handleIncomingMessage(it) } , + {t -> Crashlytics.log(Log.DEBUG, TAG, t.message) } + ) ) }