fixed issue with throwing errors if error is not defined

currently the producer was throwing "error undefined" with each message sent to kafka.