mirror of https://github.com/reiseburo/hermann
Remove exit(..) calls and replace by raising a runtime exception to Ruby.
This commit is contained in:
parent
ab4f4cca5d
commit
3a6c02f023
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue