Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An handled exception causes crash #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cieidsdk/src/main/java/it/ipzs/cieidsdk/common/CieIDSdk.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import android.os.Build
import android.provider.Settings
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.observers.DisposableSingleObserver
import io.reactivex.plugins.RxJavaPlugins
import io.reactivex.schedulers.Schedulers
import it.ipzs.cieidsdk.event.*
import it.ipzs.cieidsdk.exceptions.BlockedPinException
Expand Down Expand Up @@ -75,6 +76,12 @@ object CieIDSdk : NfcAdapter.ReaderCallback {
put(IdpService.authnRequest, deepLinkInfo.authnRequest ?: "")
put(IdpService.generaCodice, "1")
}

// handling all swallowed exception
RxJavaPlugins.setErrorHandler { error -> run {
CieIDSdkLogger.log("error handled by RxJavaPlugins $error")
callback?.onError(error)
}}

idpService.callIdp(mapValues).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
Expand Down