diff --git a/maloja/database.py b/maloja/database.py index 1177a14..a1b83fc 100644 --- a/maloja/database.py +++ b/maloja/database.py @@ -51,9 +51,11 @@ dbstatus = { } class DatabaseNotBuilt(HTTPError): def __init__(self): - super().__init__() - self.status = 503 - self.body = "The Maloja Database is still being built. Try again in a few seconds." + super().__init__( + status=503, + body="The Maloja Database is still being built. Try again in a few seconds.", + headers={"Retry-After":10} + ) SCROBBLES = [] # Format: tuple(track_ref,timestamp,saved) ARTISTS = [] # Format: artist diff --git a/maloja/server.py b/maloja/server.py index cdbe040..2ef15e8 100644 --- a/maloja/server.py +++ b/maloja/server.py @@ -270,8 +270,8 @@ def register_endpoints_web_dynamic(): template = jinja_environment.get_template(name + '.jinja') try: res = template.render(**LOCAL_CONTEXT) - except ValueError as e: - abort(404,"Entity does not exist") + except (ValueError, IndexError) as e: + abort(404,"This Artist or Track does not exist") if settings.get_settings("DEV_MODE"): jinja_environment.cache.clear()