mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 08:38:59 +00:00
render bot_create template when there's an error
This commit is contained in:
parent
63722bb7a2
commit
b688186c28
1 changed files with 3 additions and 1 deletions
2
webui.py
2
webui.py
|
@ -379,8 +379,10 @@ def bot_create():
|
|||
r = requests.get("https://{}/api/v1/instance".format(session['instance']), timeout=10)
|
||||
except requests.ConnectionError:
|
||||
session['error'] = "Couldn't connect to https://{}.".format(session['instance'])
|
||||
return render_template("bot_create.html", error = session.pop('error', None))
|
||||
except:
|
||||
session['error'] = "An unknown error occurred while trying to load https://{}".format(session['instance'])
|
||||
return render_template("bot_create.html", error = session.pop('error', None))
|
||||
|
||||
if r.status_code == 200:
|
||||
j = r.json()
|
||||
|
|
Loading…
Reference in a new issue