added error and test for syncing

@Raynos