Skip to content

Commit

Permalink
Merge pull request #2927 from 10up/fix/output-sync-error-in-dashboard
Browse files Browse the repository at this point in the history
Log error messages in the dashboard
  • Loading branch information
felipeelia authored Aug 9, 2022
2 parents 7883e4b + b2c1fae commit 6ba20ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion assets/js/sync/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
},
Expand Down

0 comments on commit 6ba20ca

Please sign in to comment.