Handle Sync Errors - Java SDK
Realm is now Atlas Device SDK – Learn More
You can configure an error handler to detect and respond to any errors that occur in the Sync process. To define an error handler, pass an ErrorHandler to the SyncConfiguration.Builder.errorHandler() builder method:
SyncConfiguration config = new SyncConfiguration.Builder(user, partition) .errorHandler((session, error) -> { // do some error handling }).build();
val user = app.currentUser() val config = SyncConfiguration.Builder(user, partition) .errorHandler { session, error -> // do some error handling } .build()
Tip
For a list of common Device Sync errors and how to handle them, refer to Sync Errors in the App Services Device Sync documentation.