From 4789f5225a0c6775f41fd4e05f8fc1949985e2be Mon Sep 17 00:00:00 2001 From: iliana weller Date: Wed, 25 Jul 2018 22:26:56 -0400 Subject: [PATCH] Add an error page Fixes #3. --- emojos.py | 2 +- templates/oh_no.html | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 templates/oh_no.html diff --git a/emojos.py b/emojos.py index 6a953e2..614eddb 100644 --- a/emojos.py +++ b/emojos.py @@ -33,7 +33,7 @@ def emojo(domain): key=operator.itemgetter('shortcode')) return render_template('emojo.html', domain=domain, emojo=emojo) except requests.exceptions.RequestException as e: - return render_template('oh_no.html') + return render_template('oh_no.html', domain=domain) @app.route('/favicon.ico') diff --git a/templates/oh_no.html b/templates/oh_no.html new file mode 100644 index 0000000..be6755e --- /dev/null +++ b/templates/oh_no.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} +{% block title %}Custom emoji list for {{ domain }}{% endblock title %} +{% block body %} +

{{ domain }} isn't a fediverse instance or doesn't have a v1/custom_emojis endpoint. :(

+{% endblock body %}