better error handling + log access to stderr

This commit is contained in:
Joeri Exelmans 2025-11-13 13:21:21 +01:00
parent 5ac29af132
commit 844215b18e
2 changed files with 11 additions and 4 deletions

View file

@ -19,6 +19,7 @@ def run_gunicorn():
options = {
"bind": "127.0.0.1:15478",
"workers": 12,
"accesslog": "/dev/stderr",
}
StandaloneApplication(app, options).run()

View file

@ -16,10 +16,16 @@ def check_property():
res.headers['Access-Control-Allow-Origin'] = '*'
res.content_type = "application/json"
return res
try:
traces = data.get("traces")
processed_traces = {}
for trace_name, trace in traces.items():
processed_traces[trace_name] = [(simtime, value) for [simtime, value] in trace]
except Exception as e:
res = make_response(jsonify("property successfully parsed, but error pre-processing trace. likely your request is not in the expected format. error was: " + str(e)))
res.headers['Access-Control-Allow-Origin'] = '*'
res.content_type = "application/json"
return res
try:
result = phi(processed_traces, time=None, quantitative=False)
except Exception as e: