mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
Attempt to fix & improve error detection:
- use std::fstream instead of boost::iostreams for properly working flush - removed some catch-all blocks - reduce catch scope of some try/catch blocks to clearly indicate intent
This commit is contained in:
@@ -77,15 +77,8 @@ void AObjectTypeHandler::init(const JsonNode & input)
|
||||
tmpl->id = Obj(type);
|
||||
tmpl->subid = subtype;
|
||||
tmpl->stringID = entry.first; // FIXME: create "fullID" - type.object.template?
|
||||
try
|
||||
{
|
||||
tmpl->readJson(entry.second);
|
||||
templates.push_back(std::shared_ptr<const ObjectTemplate>(tmpl));
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
{
|
||||
logGlobal->warn("Failed to load terrains for object %s: %s", entry.first, e.what());
|
||||
}
|
||||
tmpl->readJson(entry.second);
|
||||
templates.push_back(std::shared_ptr<const ObjectTemplate>(tmpl));
|
||||
}
|
||||
|
||||
for(const JsonNode & node : input["sounds"]["ambient"].Vector())
|
||||
|
||||
Reference in New Issue
Block a user