boxesserver: Improve error handling during rendering

Especially don't print messages for out of bound parameters into the log/stdout
This commit is contained in:
Florian Festi 2019-12-14 12:32:01 +01:00
parent fe9555a79f
commit 4a711b1cb4
1 changed files with 4 additions and 3 deletions

View File

@ -497,10 +497,11 @@ class BServer:
box.render()
box.close()
except Exception as e:
if not isinstance(e, ValueError):
traceback.print_exc()
start_response("500 Internal Server Error",
[('Content-type', 'text/plain; charset=utf-8')])
return([b"Server Error\n\n", str(e).encode("utf-8")])
headers)
return self.errorMessage(name, e, _)
http_headers = box.formats.http_headers.get(
box.format,