Throw if user asks for field not found in deck, instead of returning empty vector.
This commit is contained in:
1 parent
3f74f31c8a
commit
4cd6b84b00
2 files changed
+2
-4
No files matched your search
@@ -544,7 +544,7 @@ const std::vector<int>& EclipseGridParser::getIntegerValue(const std::string& ke
|
||||
map<string, vector<int> >::const_iterator it
|
||||
= integer_field_map_.find(keyword);
|
||||
if (it == integer_field_map_.end()) {
|
||||
return empty_integer_field_;
|
||||
THROW("No such field: " << keyword);
|
||||
} else {
|
||||
return it->second;
|
||||
}
|
||||
@@ -557,7 +557,7 @@ const std::vector<double>& EclipseGridParser::getFloatingPointValue(const std::s
|
||||
map<string, vector<double> >::const_iterator it
|
||||
= floating_field_map_.find(keyword);
|
||||
if (it == floating_field_map_.end()) {
|
||||
return empty_floating_field_;
|
||||
THROW("No such field: " << keyword);
|
||||
} else {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
@@ -186,8 +186,6 @@ private:
|
||||
std::map<std::string, std::vector<double> > floating_field_map_;
|
||||
std::map<std::string, std::tr1::shared_ptr<SpecialBase> > special_field_map_;
|
||||
std::set<std::string> ignored_fields_;
|
||||
std::vector<int> empty_integer_field_;
|
||||
std::vector<double> empty_floating_field_;
|
||||
std::tr1::shared_ptr<SpecialBase> empty_special_field_;
|
||||
EclipseUnits units_;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user