diff --git a/python-sync-actions/src/component.py b/python-sync-actions/src/component.py index e1b92c3..c2c3c9b 100644 --- a/python-sync-actions/src/component.py +++ b/python-sync-actions/src/component.py @@ -631,7 +631,25 @@ def perform_function_sync(self) -> dict: @sync_action("test_request") @sync_action_exception_handler def test_request(self): - results, response, log, error_message = self.make_call() + try: + results, response, log, error_message = self.make_call() + except Exception as e: + return { + "response": { + "status_code": None, + "reason": f"Configuration Error: {repr(e)}", + "data": None, + "headers": {}, + }, + "request": { + "url": None, + "method": None, + "data": None, + "headers": {}, + }, + "records": [], + "debug_log": f"Error during configuration/initialization: {repr(e)}", + } body = None if response.request.body: diff --git a/python-sync-actions/src/configuration.py b/python-sync-actions/src/configuration.py index c2902c1..d2081ab 100644 --- a/python-sync-actions/src/configuration.py +++ b/python-sync-actions/src/configuration.py @@ -337,7 +337,7 @@ def build_api_request(configuration: dict) -> List[Tuple[ApiRequest, RequestCont method = endpoint_config.get("method", "GET") # evaluate functions inside the params - user_parameters = configuration.get("parameters", {}).get("config", {}) + user_parameters = configuration.get("config", {}) params = endpoint_config.get("params", {}) params = ConfigHelpers().fill_in_user_parameters(params, user_parameters, evaluate_conf_objects_functions=True) request_content = build_request_content(method, params)