mh_html: print explanation for read errors

This commit is contained in:
Jean-Francois Dockes 2019-01-23 14:50:51 +01:00
parent 30d247d57f
commit f6eacd5949

View File

@ -29,17 +29,15 @@
#include <iostream> #include <iostream>
#ifndef NO_NAMESPACES
using namespace std; using namespace std;
#endif /* NO_NAMESPACES */
bool MimeHandlerHtml::set_document_file_impl(const string& mt, const string &fn) bool MimeHandlerHtml::set_document_file_impl(const string& mt, const string &fn)
{ {
LOGDEB0("textHtmlToDoc: " << fn << "\n"); LOGDEB0("textHtmlToDoc: " << fn << "\n");
string otext; string otext;
if (!file_to_string(fn, otext)) { string reason;
LOGINFO("textHtmlToDoc: cant read: " << fn << "\n"); if (!file_to_string(fn, otext, &reason)) {
LOGERR("textHtmlToDoc: cant read: " << fn << ": " << reason << "\n");
return false; return false;
} }
m_filename = fn; m_filename = fn;