oleksiyk / kafka

Apache Kafka 0.9 client for Node
MIT License
297 stars 85 forks source link

Error handling of consumer data handler #219

Closed steffansluis closed 6 years ago

steffansluis commented 6 years ago

If I understand the code correctly, the handler error is being swallowed there. This causes the consumer to keep running if the handler fails. I think it would be nice to be able to actually have an error thrown there when the handler breaks. Users should still be able to catch that error themselves by wrapping their function logic in a try catch if need be.

oleksiyk commented 6 years ago

You should catch and process your handler errors yourself, there cannot be a suitable solution for everyone: one would want to keep running, someone else would want to terminate the process. So just wrap your handler and do what you need.