From 5b6a72f62fd5b6ffb74378cfcc491c622db8c49f Mon Sep 17 00:00:00 2001
From: Marco Biasini <marco.biasini@unibas.ch>
Date: Wed, 13 Jun 2012 17:56:29 +0200
Subject: [PATCH] setting unknown builder as default should not abort

instead of asserting that the builder has been registered,
throw a runtime error stating that the builder is not
known.

Fixes BZDNG-346
---
 modules/conop/src/conop.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/conop/src/conop.cc b/modules/conop/src/conop.cc
index 138d62c7c..f72956f1a 100644
--- a/modules/conop/src/conop.cc
+++ b/modules/conop/src/conop.cc
@@ -161,7 +161,8 @@ void Conopology::SetDefaultBuilder(const String& default_name) {
   if (builder)
     builder_map_["DEFAULT"]=builder;
   else
-    assert(0 && "what is this?");
+    throw std::runtime_error("trying to set unknown builder '"+
+                             default_name+"' as the default");
 }
 
 BuilderP Conopology::GetBuilder(const String& name)
-- 
GitLab