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,
|
if (!(config->rk = rd_kafka_new(RD_KAFKA_CONSUMER, config->conf,
|
||||||
config->errstr, sizeof(config->errstr)))) {
|
config->errstr, sizeof(config->errstr)))) {
|
||||||
fprintf(stderr, "%% Failed to create new consumer: %s\n", 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 */
|
/* 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)))) {
|
if (!(config->rk = rd_kafka_new(RD_KAFKA_PRODUCER, config->conf, config->errstr, sizeof(config->errstr)))) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%% Failed to create new producer: %s\n", config->errstr);
|
"%% 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 */
|
/* Set logger */
|
||||||
|
|
Loading…
Reference in New Issue