Fix html_fallback and logged error message
This commit is contained in:
parent
07143dd433
commit
f38dda5f16
@ -59,19 +59,11 @@ html_fallback = """<!DOCTYPE html>
|
|||||||
</td>
|
</td>
|
||||||
<td style="padding-left: 40px;">
|
<td style="padding-left: 40px;">
|
||||||
<p><span style="font-size:120%;color:red">The error.html template could not be found!<br>Please check your qutebrowser installation</span><br>
|
<p><span style="font-size:120%;color:red">The error.html template could not be found!<br>Please check your qutebrowser installation</span><br>
|
||||||
%ERROR%</p>
|
%ERROR%</p>
|
||||||
<h1>Unable to load page</h1>
|
|
||||||
Error while opening {{ url }}: <br>
|
|
||||||
<p id="error-message-text" style="color: #a31a1a;">{{ error }}</p><br><br>
|
|
||||||
|
|
||||||
<form name="bl">
|
|
||||||
<input type="button" value="Try again" onclick="javascript:location.reload();" />
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
"""
|
"""
|
||||||
@ -93,7 +85,7 @@ class Loader(jinja2.BaseLoader):
|
|||||||
source = utils.read_file(path)
|
source = utils.read_file(path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
source = html_fallback.replace("%ERROR%", html.escape(str(e)))
|
source = html_fallback.replace("%ERROR%", html.escape(str(e)))
|
||||||
log.misc.error("The error.html template could not be found" + path)
|
log.misc.error("The error.html template could not be found at " + path)
|
||||||
# Currently we don't implement auto-reloading, so we always return True
|
# Currently we don't implement auto-reloading, so we always return True
|
||||||
# for up-to-date.
|
# for up-to-date.
|
||||||
return source, path, lambda: True
|
return source, path, lambda: True
|
||||||
|
Loading…
Reference in New Issue
Block a user