diff --git a/assets/js/sync/index.js b/assets/js/sync/index.js index 194bb2bb48..5f1aca710a 100644 --- a/assets/js/sync/index.js +++ b/assets/js/sync/index.js @@ -124,12 +124,19 @@ const App = () => { } /** - * Log any messages. + * Log any error messages created by the browser. */ if (error.message) { logMessage(error.message, 'error'); } + /** + * Log any error messages created by the back-end. + */ + if (error.data?.message) { + logMessage(error.data.message, 'error'); + } + logMessage(__('Sync failed', 'elasticpress'), 'error'); updateState({ isSyncing: false }); },