Correctly handle error gracefully in the RxBus that receives information from the Node through graphenej, to avoid a crash.

master
Severiano Jaramillo 2019-02-20 17:12:41 -06:00
parent 8d257876a0
commit 4ad841d525
1 changed files with 5 additions and 1 deletions

View File

@ -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) }
)
)
}