summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/OpaqueEndpointI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/OpaqueEndpointI.cpp')
-rw-r--r--cpp/src/Ice/OpaqueEndpointI.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/cpp/src/Ice/OpaqueEndpointI.cpp b/cpp/src/Ice/OpaqueEndpointI.cpp
index 2be3b400dcb..3d63538ec56 100644
--- a/cpp/src/Ice/OpaqueEndpointI.cpp
+++ b/cpp/src/Ice/OpaqueEndpointI.cpp
@@ -377,19 +377,17 @@ IceInternal::OpaqueEndpointI::checkOption(const string& option, const string& ar
ex.str = "no argument provided for -v option in endpoint " + endpoint;
throw ex;
}
- for(string::size_type i = 0; i < argument.size(); ++i)
+
+ try
+ {
+ const_cast<vector<Byte>&>(_rawBytes) = Base64::decode(argument);
+ }
+ catch(const IceUtil::IllegalArgumentException& ex)
{
- if(!Base64::isBase64(argument[i]))
- {
- EndpointParseException ex(__FILE__, __LINE__);
- ostringstream ostr;
- ostr << "invalid base64 character `" << argument[i] << "' (ordinal " << static_cast<int>(argument[i])
- << ") in endpoint " << endpoint;
- ex.str = ostr.str();
- throw ex;
- }
+ ostringstream os;
+ os << "Invalid Base64 input in opaque endpoint `" << endpoint << "'\n" << ex;
+ throw EndpointParseException(__FILE__, __LINE__, os.str());
}
- const_cast<vector<Byte>&>(_rawBytes) = Base64::decode(argument);
return true;
}