Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
Do not throw an exception when an inner member fails to parse
Browse files Browse the repository at this point in the history
  • Loading branch information
matusnovak committed May 25, 2021
1 parent 0c8522d commit e2083f2
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/Doxybook/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,29 @@ Doxybook2::Node::parse(NodeCacheMap& cache, const std::string& inputDir, const N
});
};

innerProcess(compounddef, "innerclass");
innerProcess(compounddef, "innerstruct");
innerProcess(compounddef, "innernamespace");
if (isGroupOrFile) {
innerProcess(compounddef, "innergroup");
innerProcess(compounddef, "innerdir");
innerProcess(compounddef, "innerfile");
}

if (!isGroupOrFile) {
ptr->parseInheritanceInfo(compounddef);
}

ptr->parseBaseInfo(compounddef);

auto parseSafely = [&](const std::string& innerName) {
try {
innerProcess(compounddef, innerName);
} catch (std::exception& e) {
WARNING("Failed to parse inner member of {} error: {}", innerName, e.what());
}
};

parseSafely("innerclass");
parseSafely("innerstruct");
parseSafely("innernamespace");
if (isGroupOrFile) {
parseSafely("innergroup");
parseSafely("innerdir");
parseSafely("innerfile");
}

return ptr;
}

Expand Down

0 comments on commit e2083f2

Please # to comment.