Docs Menu
Docs Home
/ /
Atlas Device SDKs
/ /

Handle Sync Errors - Java SDK

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.

Back

Manage Flexible Sync Subscriptions