Created
December 27, 2018 11:35
-
-
Save herecydev/c68674d60f1ef708d431b6e166b059ca to your computer and use it in GitHub Desktop.
errorhandler.js
This file contains 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 taskHandler = async (task) => { | |
try { | |
log.info("Executing {taskId}", { taskId: task.taskId }); | |
const handler = await import(`handlers/${task.taskId}`); | |
return await handler.execute(task); | |
} | |
catch (error) { | |
log.error(error, "Task Handler {taskId} failed", { taskId: task.taskId }); | |
return -1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment