Added exception for unknown key
This commit is contained in:
@@ -296,6 +296,10 @@ const std::string& Hazelnupp::GetExecutableName() const
|
||||
|
||||
const Value& Hazelnupp::operator[](const std::string& key) const
|
||||
{
|
||||
// Throw exception if param is unknown
|
||||
if (!HasParam(key))
|
||||
throw HazelnuppInvalidKeyException();
|
||||
|
||||
return *parameters.find(key)->second->GetValue();
|
||||
}
|
||||
|
||||
|
@@ -27,26 +27,26 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
|
@@ -19,6 +19,13 @@ protected:
|
||||
std::string message;
|
||||
};
|
||||
|
||||
class HazelnuppInvalidKeyException : public HazelnuppException
|
||||
{
|
||||
public:
|
||||
HazelnuppInvalidKeyException() : HazelnuppException() {};
|
||||
HazelnuppInvalidKeyException(const std::string& msg) : HazelnuppException(msg) {};
|
||||
};
|
||||
|
||||
class HazelnuppConstraintException : public HazelnuppException
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user