summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/DescriptorHelper.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-11-25 15:08:03 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-11-25 15:08:03 +0000
commitcfe3c0bef5cb30eb416fe1618f6cdd38f49397e5 (patch)
treefe802f2e506a6cede149ea6ae03d1c1bfb6d7b18 /cpp/src/IceGrid/DescriptorHelper.cpp
parentAdded IcePatch2.Admin.RegisterProcess (diff)
downloadice-cfe3c0bef5cb30eb416fe1618f6cdd38f49397e5.tar.bz2
ice-cfe3c0bef5cb30eb416fe1618f6cdd38f49397e5.tar.xz
ice-cfe3c0bef5cb30eb416fe1618f6cdd38f49397e5.zip
Fixed bug 673 & 670.
Diffstat (limited to 'cpp/src/IceGrid/DescriptorHelper.cpp')
-rw-r--r--cpp/src/IceGrid/DescriptorHelper.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp
index 6d4767398c8..a85d3fbe3ec 100644
--- a/cpp/src/IceGrid/DescriptorHelper.cpp
+++ b/cpp/src/IceGrid/DescriptorHelper.cpp
@@ -309,20 +309,40 @@ Resolver::operator()(const string& value, const string& name, bool allowEmpty, b
{
try
{
- string val = substitute(value, useParams);
- if(!allowEmpty && val.empty())
+ string val;
+ try
{
- throw "empty value";
+ val = substitute(value, useParams);
+ }
+ catch(const string& reason)
+ {
+ throw "invalid variable `" + value + "': " + reason;
+ }
+ catch(const char* reason)
+ {
+ throw "invalid variable `" + value + "': " + reason;
+ }
+
+ if(!allowEmpty)
+ {
+ if(value.empty())
+ {
+ throw "empty string";
+ }
+ else if(val.empty())
+ {
+ throw "the value of the variable `" + value + "' is an empty string";
+ }
}
return val;
}
catch(const string& reason)
{
- exception("invalid value `" + value + "' for `" + name + "': " + reason);
+ exception("invalid value for attribute `" + name + "': " + reason);
}
catch(const char* reason)
{
- exception("invalid value `" + value + "' for `" + name + "': " + reason);
+ exception("invalid value for attribute `" + name + "': " + reason);
}
return ""; // To prevent compiler warning.
}
@@ -444,7 +464,7 @@ Resolver::substitute(const string& v, bool useParams) const
end = value.find("}", beg);
if(end == string::npos)
{
- throw "malformed variable name";
+ throw "malformed variable name `" + value + "'";
}
//