summaryrefslogtreecommitdiff
path: root/src/RSS.cpp
diff options
context:
space:
mode:
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;
}
}