1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-19 15:57:05 +01:00

catch exceptions by ref

This commit is contained in:
2024-02-10 19:38:02 +01:00
parent e8b0565164
commit 442624912e
3 changed files with 9 additions and 9 deletions

View File

@ -36,7 +36,7 @@ unsigned int RunContext::addFunction(const string &name, DoubleFunction *init)
return getFunctionAddress(name);
}
catch (Exceptions::Definition)
catch (Exceptions::Definition &)
{
unsigned int address = fTable_.size();
@ -55,7 +55,7 @@ unsigned int RunContext::addVariable(const string &name, double init)
return getVariableAddress(name);
}
catch (Exceptions::Definition)
catch (Exceptions::Definition &)
{
unsigned int address = vTable_.size();
@ -92,7 +92,7 @@ unsigned int RunContext::getFunctionAddress(const string &name) const
{
return fTable_.at(name);
}
catch (out_of_range)
catch (out_of_range &)
{
LATAN_ERROR(Definition, "undefined function '" + name + "'");
}
@ -139,7 +139,7 @@ unsigned int RunContext::getVariableAddress(const string &name) const
{
return vTable_.at(name);
}
catch (out_of_range)
catch (out_of_range &)
{
LATAN_ERROR(Definition, "undefined variable '" + name + "'");
}
@ -449,7 +449,7 @@ try\
{\
address = (table).at(name);\
}\
catch (out_of_range)\
catch (out_of_range &)\
{\
address = (table).size();\
(table)[(name)] = address;\

View File

@ -105,12 +105,12 @@ const IoT& File::getData(const std::string &name) const
{
return dynamic_cast<const IoT &>(*(data_.at(name)));
}
catch(std::out_of_range)
catch (std::out_of_range &)
{
LATAN_ERROR(Definition, "no data with name '" + name + "' in file "
+ name_);
}
catch(std::bad_cast)
catch (std::bad_cast &)
{
LATAN_ERROR(Definition, "data with name '" + name + "' in file "
+ name_ + " does not have type '" + typeid(IoT).name()