archive
/
lantern
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
lantern/lantern/error.py

13 lines
313 B
Python

from jinja2 import Template
from sanic.response import html
import os
TEMPLATE = os.path.join(os.path.dirname(__file__), 'templates', 'error.html')
def error_response(error_str):
with open(TEMPLATE) as f:
template = Template(f.read())
return html(template.render(error=error_str), status=500)