Add error page for http functions

This commit is contained in:
Peter Stockings
2024-03-24 22:28:58 +11:00
parent fc021d6971
commit ea366d9f8b
2 changed files with 150 additions and 0 deletions

3
app.py
View File

@@ -313,6 +313,9 @@ def execute_http_function(user_id, function):
request_data if log_request else {},
response_data['result'] if (log_response or response_data['status'] != 'SUCCESS') else {},
response_data['logs'])
if response_data['status'] != 'SUCCESS':
return render_template("function_error.html", function_name=function_name ,error=response_data['result'], logs=response_data['logs'])
# Map the Node.js response to Flask response
flask_response = map_isolator_response_to_flask_response(response_data)