Remove exit(..) calls and replace by raising a runtime exception to Ruby.

This commit is contained in:
Stan Campbell 2014-09-05 10:07:43 -07:00
parent ab4f4cca5d
commit 3a6c02f023
1 changed files with 2 additions and 2 deletions

View File

@ -308,7 +308,7 @@ void consumer_init_kafka(HermannInstanceConfig* config) {
if (!(config->rk = rd_kafka_new(RD_KAFKA_CONSUMER, config->conf,
config->errstr, sizeof(config->errstr)))) {
fprintf(stderr, "%% Failed to create new consumer: %s\n", config->errstr);
exit(1);
rb_raise(rb_eRuntimeError, "%% Failed to create new consumer: %s\n", config->errstr);
}
/* Set logger */
@ -470,7 +470,7 @@ void producer_init_kafka(HermannInstanceConfig* config) {
if (!(config->rk = rd_kafka_new(RD_KAFKA_PRODUCER, config->conf, config->errstr, sizeof(config->errstr)))) {
fprintf(stderr,
"%% Failed to create new producer: %s\n", config->errstr);
exit(1);
rb_raise(rb_eRuntimeError, "%% Failed to create new producer: %s\n", config->errstr);
}
/* Set logger */