Created
November 13, 2023 21:35
-
-
Save rs77/d28ea4e0fe197c1cf611f9b19071e11e to your computer and use it in GitHub Desktop.
Suitescript summarize function for a Map/Reduce script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const summarize = (summaryContext) => { | |
log.debug({title: 'SUMMARY', details: summaryContext}); | |
if (summaryContext.inputSummary.error) { | |
log.error({title: 'INPUT ERROR', details: summaryContext.inputSummary.error}); | |
} | |
summaryContext.mapSummary.errors.iterator().each( | |
(key, error) => { | |
log.error({title: `MAP ERROR: ${key}`, details: error}); | |
return true; | |
} | |
); | |
summaryContext.reduceSummary.errors.iterator().each( | |
(key, error) => { | |
log.error({title: `REDUCE ERROR: ${key}`, details: error}); | |
return true; | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment