From 566742c6fa0e1c689cfabd60a7989d7ad48db66c Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 25 Jan 2015 23:15:15 +0100 Subject: Fixed missing break and context not being displayed if source file could not be parsed --- src/core/resource/ResourceManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/resource/ResourceManager.cpp b/src/core/resource/ResourceManager.cpp index 03fd65b..11d01a7 100644 --- a/src/core/resource/ResourceManager.cpp +++ b/src/core/resource/ResourceManager.cpp @@ -103,22 +103,21 @@ Rooted ResourceManager::parse(Registry ®istry, ParserContext &ctx, ParserScope scope; // New empty parser scope instance ParserContext childCtx = ctx.clone(scope, sourceId); node = req.getParser()->parse(reader, childCtx); + break; } case ParseMode::INCLUDE: { ParserContext childCtx = ctx.clone(sourceId); node = req.getParser()->parse(reader, childCtx); + break; } } } if (node == nullptr) { - throw LoggableException{"File \"" + resource.getLocation() + + throw LoggableException{"Requested file \"" + resource.getLocation() + "\" cannot be parsed."}; } } catch (LoggableException ex) { - // Remove all data associated with the allocated source id - purgeResource(sourceId); - // Log the exception and return nullptr ctx.getLogger().log(ex); return nullptr; -- cgit v1.2.3