Return 404 when channel could not be added and still does not exist.

This commit is contained in:
voussoir 2020-08-12 10:28:06 -07:00
parent 7a7b1455ef
commit ee89582a1b

View file

@ -26,7 +26,10 @@ def get_channel(channel_id=None, download_filter=None):
common.ycdldb.add_channel(channel_id)
except Exception:
traceback.print_exc()
channel = common.ycdldb.get_channel(channel_id)
try:
channel = common.ycdldb.get_channel(channel_id)
except ycdl.exceptions.NoSuchChannel:
flask.abort(404)
else:
channel = None