summaryrefslogtreecommitdiff
path: root/src/RSS.cpp
diff options
context:
space:
mode:
authorPhysick <96335032+DegustatorPonos@users.noreply.github.com>2026-05-11 14:10:04 +0500
committerPhysick <96335032+DegustatorPonos@users.noreply.github.com>2026-05-11 14:10:04 +0500
commit325c7b7b493b4f760acd392f97d2b512e4b3f34e (patch)
treea46cc6ded67d86cee660719cca1c9e5395a44cc2 /src/RSS.cpp
parent9ec645b5678f7bb15c26c52dd3abf7ed52e96667 (diff)
RSS spec compliance updateHEADmaster
Diffstat (limited to 'src/RSS.cpp')
-rw-r--r--src/RSS.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/RSS.cpp b/src/RSS.cpp
index 20c809f..a5c8b12 100644
--- a/src/RSS.cpp
+++ b/src/RSS.cpp
@@ -67,7 +67,9 @@ void RSS::parse(std::string contents) {
// std::cout << "starting tokenization..." << std::endl;
if (contents.length() == 0) return;
try {
- auto leaf = XML_leaf(contents).GetChild("channel");
+ auto leaf = XML_leaf(contents);
+ if (leaf.Name != "channel")
+ leaf = leaf.GetChild("channel");
if (leaf.Raw == "<>")
throw new std::runtime_error("The feed does not contain <channel> element");
@@ -76,8 +78,8 @@ void RSS::parse(std::string contents) {
auto items = leaf.GetChildren("item");
for (auto item : items)
Entries.push_back(RSS_Entry(item));
- } catch (const char *err) {
- std::cout << "Failed to parse feed '" << URL << "' :" << err << std::endl;
+ } catch (std::exception& err) {
+ std::cout << "Failed to parse feed '" << URL << "' :" << err.what() << std::endl;
return;
}
}