Skip to content

Commit

Permalink
chore: add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed May 31, 2022
1 parent e0e367b commit bc47cf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/datalayer/persistance.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export const pushChangeListToDataLayer = async (storeId, changelist) => {
return true;
}

logger.error(
`There was an error pushing your changes to the datalayer, ${JSON.stringify(
data,
)}`,
);
return false;
} catch (error) {
logger.info('There was an error pushing your changes to the datalayer');
Expand Down
4 changes: 4 additions & 0 deletions src/datalayer/writeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ const pushChangesWhenStoreIsAvailable = async (
2,
)}`,
);

const success = await dataLayer.pushChangeListToDataLayer(
storeId,
changeList,
);

if (!success) {
logger.info(
`RPC failed when pushing to store ${storeId}, attempting retry.`,
);
retry(storeId, changeList, failedCallback, retryAttempts);
}
} else {
Expand Down

0 comments on commit bc47cf2

Please sign in to comment.