Return error if fulltext is empty.

This commit is contained in:
tastytea 2019-05-18 13:51:41 +02:00
parent 3c8f9d8c7f
commit 6036e6c35d
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,11 @@ int main(const int argc, const char *argv[])
{
URI uri(opts.uri);
html_extract page = uri.get();
if (page.fulltext.empty())
{
cerr << "Error: Could not fetch page.";
return 4;
}
db.store({opts.uri, uri.archive(), system_clock::now(), opts.tags,
page.title, page.description, page.fulltext});
}