From fcb86bba9e8ea7e3c93f7f1748c0291b307c46ed Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 4 Sep 2012 23:01:55 +0300 Subject: [PATCH] It's okay to throw exceptions from Loader functions --- source/component.cpp | 2 +- source/sourcepackage.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/component.cpp b/source/component.cpp index 8a57b64..6bfce1f 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -302,5 +302,5 @@ void Component::Loader::use(const string &n) obj.uses.push_back(&*i); return; } - error(format("Unknown library component '%s'", n)); + throw invalid_argument("Component::Loader::use"); } diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index 6eaba73..5c83fd7 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -235,7 +235,7 @@ void SourcePackage::Loader::if_feature(const string &cond) if(equals!=string::npos) { if(equals==0) - error("No feature name specified"); + throw invalid_argument("SourcePackage::Loader::if_feature"); bool negate = cond[equals-1]=='!'; string name = cond.substr(0, equals-negate); string value = obj.config.get_option("with_"+name).value; -- 2.45.2