From a8ca464cee14ad8d0782f626c7f36216dba2e400 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 14 Mar 2019 15:22:19 -0400 Subject: Log warning messages _before_ exiting because of earlier dcfg failure This helps diagnostics. --- src/lib/pubsub/pubsub_build.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/pubsub') diff --git a/src/lib/pubsub/pubsub_build.c b/src/lib/pubsub/pubsub_build.c index 64cdcc1d57..1dc20f51f4 100644 --- a/src/lib/pubsub/pubsub_build.c +++ b/src/lib/pubsub/pubsub_build.c @@ -281,11 +281,14 @@ pubsub_builder_finalize(pubsub_builder_t *builder, dispatch_t *dispatcher = NULL; tor_assert_nonfatal(builder->n_connectors == 0); - if (builder->n_errors) + if (pubsub_builder_check(builder) < 0) goto err; - if (pubsub_builder_check(builder) < 0) + if (builder->n_errors) { + log_warn(LD_GENERAL, "At least one error occurred previously when " + "configuring the dispatcher."); goto err; + } dispatcher = dispatch_new(builder->cfg); -- cgit v1.2.3-54-g00ecf