forked from Hay1tsme/artemis
index: additional logging for malformed return data
This commit is contained in:
parent
61e3a2c930
commit
02078080a8
9
index.py
9
index.py
@ -160,9 +160,16 @@ class HttpDispatcher(resource.Resource):
|
||||
|
||||
if type(ret) == str:
|
||||
return ret.encode()
|
||||
elif type(ret) == bytes:
|
||||
|
||||
elif type(ret) == bytes or type(ret) == tuple: # allow for bytes or tuple (data, response code) responses
|
||||
return ret
|
||||
|
||||
elif ret is None:
|
||||
self.logger.warn(f"None returned by controller for {request.uri.decode()} endpoint")
|
||||
return b""
|
||||
|
||||
else:
|
||||
self.logger.warn(f"Unknown data type returned by controller for {request.uri.decode()} endpoint")
|
||||
return b""
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user