X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsourcepackage.cpp;h=4f42051e6b654d9baac64fabde7bb44e479e6ebe;hb=0c83b922e56976a30506d9f8d43c9dcd38d573b5;hp=a466089ae75aad13b049d5e5e3660a930f597ec3;hpb=8d7926359d2477a9928d7367678314bcbc1f6e81;p=builder.git diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index a466089..4f42051 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -1,10 +1,3 @@ -/* $Id$ - -This file is part of builder -Copyright © 2007-2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #include #include #include @@ -76,7 +69,7 @@ LibMode SourcePackage::get_library_mode() const else if(mode=="none") return DYNAMIC; else - throw Exception("Unknown library mode"); + throw runtime_error("unknown library mode"); } string SourcePackage::expand_string(const string &str) const @@ -87,7 +80,7 @@ string SourcePackage::expand_string(const string &str) const while((dollar = result.find('$'))!=string::npos) { if(n>1000) - throw Exception("Too much variable expansions"); + throw bad_expansion("nested too deep"); string::size_type end; string var; @@ -95,7 +88,7 @@ string SourcePackage::expand_string(const string &str) const { end = result.find('}', dollar+2); if(end==string::npos) - throw Exception("Unterminated variable reference"); + throw bad_expansion("unterminated variable reference"); var = result.substr(dollar+2, end-dollar-2); ++end; }