diff --git a/app.py b/app.py index e38c477..b4bbd5e 100644 --- a/app.py +++ b/app.py @@ -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) diff --git a/templates/function_error.html b/templates/function_error.html new file mode 100644 index 0000000..0afee44 --- /dev/null +++ b/templates/function_error.html @@ -0,0 +1,147 @@ +{% extends 'base.html' %} + +{% block content %} + +
500
+Server Error
+Whoops, something went wrong with {{function_name}}.
+ +