Add an error page

Fixes #3.
This commit is contained in:
iliana weller 2018-07-25 22:26:56 -04:00
parent 57848ec2c2
commit 4789f5225a
No known key found for this signature in database
GPG Key ID: DCE341C8E949BC81
2 changed files with 6 additions and 1 deletions

View File

@ -33,7 +33,7 @@ def emojo(domain):
key=operator.itemgetter('shortcode')) key=operator.itemgetter('shortcode'))
return render_template('emojo.html', domain=domain, emojo=emojo) return render_template('emojo.html', domain=domain, emojo=emojo)
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
return render_template('oh_no.html') return render_template('oh_no.html', domain=domain)
@app.route('/favicon.ico') @app.route('/favicon.ico')

5
templates/oh_no.html Normal file
View File

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block title %}Custom emoji list for {{ domain }}{% endblock title %}
{% block body %}
<p><b>{{ domain }}</b> isn't a fediverse instance or doesn't have a <code>v1/custom_emojis</code> endpoint. :(</p>
{% endblock body %}