Correctly handle error gracefully in the RxBus that receives information from the Node through graphenej, to avoid a crash.
This commit is contained in:
parent
8d257876a0
commit
4ad841d525
1 changed files with 5 additions and 1 deletions
|
@ -9,6 +9,7 @@ import android.os.IBinder
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
|
import com.crashlytics.android.Crashlytics
|
||||||
import cy.agorise.graphenej.api.ConnectionStatusUpdate
|
import cy.agorise.graphenej.api.ConnectionStatusUpdate
|
||||||
import cy.agorise.graphenej.api.android.NetworkService
|
import cy.agorise.graphenej.api.android.NetworkService
|
||||||
import cy.agorise.graphenej.api.android.RxBus
|
import cy.agorise.graphenej.api.android.RxBus
|
||||||
|
@ -43,7 +44,10 @@ abstract class ConnectedFragment : Fragment(), ServiceConnection {
|
||||||
RxBus.getBusInstance()
|
RxBus.getBusInstance()
|
||||||
.asFlowable()
|
.asFlowable()
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe { handleIncomingMessage(it) }
|
.subscribe(
|
||||||
|
{ handleIncomingMessage(it) } ,
|
||||||
|
{t -> Crashlytics.log(Log.DEBUG, TAG, t.message) }
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue