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

Commit e2083f2

Browse files
committed
Do not throw an exception when an inner member fails to parse
1 parent 0c8522d commit e2083f2

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/Doxybook/Node.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,29 @@ Doxybook2::Node::parse(NodeCacheMap& cache, const std::string& inputDir, const N
114114
});
115115
};
116116

117-
innerProcess(compounddef, "innerclass");
118-
innerProcess(compounddef, "innerstruct");
119-
innerProcess(compounddef, "innernamespace");
120-
if (isGroupOrFile) {
121-
innerProcess(compounddef, "innergroup");
122-
innerProcess(compounddef, "innerdir");
123-
innerProcess(compounddef, "innerfile");
124-
}
125-
126117
if (!isGroupOrFile) {
127118
ptr->parseInheritanceInfo(compounddef);
128119
}
129120

130121
ptr->parseBaseInfo(compounddef);
122+
123+
auto parseSafely = [&](const std::string& innerName) {
124+
try {
125+
innerProcess(compounddef, innerName);
126+
} catch (std::exception& e) {
127+
WARNING("Failed to parse inner member of {} error: {}", innerName, e.what());
128+
}
129+
};
130+
131+
parseSafely("innerclass");
132+
parseSafely("innerstruct");
133+
parseSafely("innernamespace");
134+
if (isGroupOrFile) {
135+
parseSafely("innergroup");
136+
parseSafely("innerdir");
137+
parseSafely("innerfile");
138+
}
139+
131140
return ptr;
132141
}
133142

0 commit comments

Comments
 (0)