Avoid two crashlytics reported crashes due to unhandled errors in RxJava operations in the CreateAccountFragment.

master
Severiano Jaramillo 2019-03-17 09:32:11 -06:00
parent 5238d4973c
commit 6f806db127
2 changed files with 13 additions and 4 deletions

View File

@ -51,7 +51,7 @@ abstract class ConnectedFragment : Fragment(), ServiceConnection {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{ handleIncomingMessage(it) } ,
{t -> Crashlytics.log(Log.DEBUG, TAG, t.message) }
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
}

View File

@ -79,7 +79,10 @@ class CreateAccountFragment : BaseAccountFragment() {
.skipInitialValue()
.debounce(800, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe { validateAccountName(it.toString()) }
.subscribe(
{ validateAccountName(it.toString()) },
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
// Use RxJava Debounce to update the PIN error only after the user stops writing for > 500 ms
@ -88,7 +91,10 @@ class CreateAccountFragment : BaseAccountFragment() {
.skipInitialValue()
.debounce(500, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe { validatePIN() }
.subscribe(
{ validatePIN() },
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
// Use RxJava Debounce to update the PIN Confirmation error only after the user stops writing for > 500 ms
@ -97,7 +103,10 @@ class CreateAccountFragment : BaseAccountFragment() {
.skipInitialValue()
.debounce(500, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe { validatePINConfirmation() }
.subscribe(
{ validatePINConfirmation() },
{ Crashlytics.log(Log.DEBUG, TAG, it.message) }
)
)
btnCancel.setOnClickListener { findNavController().navigateUp() }