Skip to content

Commit

Permalink
Add Global Error Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
avazirna committed Jul 4, 2024
1 parent 623997b commit fd4b1c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/org/commcare/CommCareApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
import io.noties.markwon.Markwon;
import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
import io.noties.markwon.ext.tables.TablePlugin;
import io.reactivex.plugins.RxJavaPlugins;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

Expand Down Expand Up @@ -251,8 +252,9 @@ public void onCreate() {
FirebaseMessagingUtil.verifyToken();

customiseOkHttp();
}

setRxJavaGlobalHandler();
}

protected void loadSqliteLibs() {
SQLiteDatabase.loadLibs(this);
Expand Down Expand Up @@ -1206,4 +1208,10 @@ public boolean isNsdServicesEnabled() {
public void customiseOkHttp() {
CommCareNetworkServiceGenerator.customizeRetrofitSetup(new OkHttpBuilderCustomConfig());
}

private void setRxJavaGlobalHandler() {
RxJavaPlugins.setErrorHandler(throwable -> {
// Not sure the type of exceptions we should handle here
});
}
}

0 comments on commit fd4b1c3

Please sign in to comment.