mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 11:22:38 -04:00
Change kiwix::fileExists to kiwix::fileReadable
This commit is contained in:
parent
b974e121b4
commit
74d3bffde0
@ -86,8 +86,8 @@ string loadCustomTemplate (string customIndexPath) {
|
||||
customIndexPath = kiwix::isRelativePath(customIndexPath) ?
|
||||
kiwix::computeAbsolutePath(kiwix::getCurrentDirectory(), customIndexPath) :
|
||||
customIndexPath;
|
||||
if (!kiwix::fileExists(customIndexPath)) {
|
||||
throw runtime_error("No such file exist (or file is not readable)" + customIndexPath);
|
||||
if (!kiwix::fileReadable(customIndexPath)) {
|
||||
throw runtime_error("No such file exist (or file is not readable) " + customIndexPath);
|
||||
}
|
||||
if (kiwix::getMimeTypeForFile(customIndexPath) != "text/html") {
|
||||
throw runtime_error("Invalid File Mime Type " + kiwix::getMimeTypeForFile(customIndexPath));
|
||||
|
Loading…
x
Reference in New Issue
Block a user