1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Improved API logging slightly

This commit is contained in:
Krateng 2020-09-18 18:56:09 +02:00
parent 6dd3fe5512
commit 8250c7b467
No known key found for this signature in database
GPG Key ID: 46735607861C6FCE
2 changed files with 2 additions and 2 deletions

View File

@ -67,6 +67,7 @@ class APIHandler:
if exceptiontype in self.errors:
response.status,result = self.errors[exceptiontype]
else:
log("Unhandled Exception with " + self.__apiname__ + ": " + str(exceptiontype))
response.status,result = 500,{"status":"Unknown error","code":500}
return result
@ -81,7 +82,7 @@ class APIHandler:
methodname = self.get_method(path,keys)
method = self.methods[methodname]
except:
log("Could not find a handler for method " + methodname + " in API " + self.__apiname__,module="debug")
log("Could not find a handler for method " + str(methodname) + " in API " + self.__apiname__,module="debug")
log("Keys: " + str(keys),module="debug")
raise InvalidMethodException()
return method(path,keys)

View File

@ -141,7 +141,6 @@ def get_performance_external(**keys):
@api.get("top/artists")
def get_top_artists_external(**keys):
print(uri_to_internal(keys))
_, k_time, k_internal, _, _ = uri_to_internal(keys)
ckeys = {**k_time, **k_internal}