Skip to content

Commit 79ae470

Browse files
author
vikasrohit
authored
Merge pull request #5 from maxceem/develop
fix: error finally() is not a function
2 parents 180919b + 4fb7786 commit 79ae470

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/app.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ const dataHandler = (messageSet, topic, partition) => Promise.each(messageSet, (
5656
throw new Error(`Invalid topic: ${topic}`)
5757
}
5858
})()
59-
// commit offset regardless of errors
60-
.then(() => {})
61-
.catch((err) => { logger.logFullError(err) })
62-
.finally(() => consumer.commitOffset({ topic, partition, offset: m.offset }))
59+
.then(() => {
60+
consumer.commitOffset({ topic, partition, offset: m.offset })
61+
})
62+
.catch((err) => {
63+
logger.logFullError(err)
64+
// commit offset regardless of errors
65+
consumer.commitOffset({ topic, partition, offset: m.offset })
66+
})
6367
})
6468

6569
/**

0 commit comments

Comments
 (0)