aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-09-29 03:02:23 +0000
committerlloyd <[email protected]>2007-09-29 03:02:23 +0000
commit9af598c2f3e1c5b8c59e770d33903c8bb26d170e (patch)
tree7b721aae6b7c7ba506a1b5fd93ef8d3212d04119
parent0d2d18b2d07879467ff83693d809872160cac0d9 (diff)
If DL_Group's constructor can't find a group, throw a reasonably informative
exception instead of one for a PEM decode error which is not very helpful.
-rw-r--r--src/dl_group.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dl_group.cpp b/src/dl_group.cpp
index 9d50458dd..1b52102db 100644
--- a/src/dl_group.cpp
+++ b/src/dl_group.cpp
@@ -28,7 +28,12 @@ DL_Group::DL_Group()
*************************************************/
DL_Group::DL_Group(const std::string& type)
{
- DataSource_Memory pem(global_config().get("dl", type));
+ std::string grp_contents = global_config().get("dl", type);
+
+ if(grp_contents == "")
+ throw Invalid_Argument("DL_Group: Unknown group " + type);
+
+ DataSource_Memory pem(grp_contents);
PEM_decode(pem);
}