Support connectors that return logs (#230)

This commit is contained in:
jbirddog 2023-04-28 10:54:24 -04:00 committed by GitHub
parent 393fac80a7
commit 87c34f4822
2 changed files with 7 additions and 1 deletions

View File

@ -91,6 +91,13 @@ class ServiceTaskDelegate:
json_parse_error = e
parsed_response = {}
if "spiff__logs" in parsed_response:
for log in parsed_response["spiff__logs"]:
current_app.logger.info(f"Log from connector {name}: {log}")
if "api_response" in parsed_response:
parsed_response = parsed_response["api_response"]
response_text = json.dumps(parsed_response)
if proxied_response.status_code >= 300:
message = ServiceTaskDelegate.get_message_for_status(proxied_response.status_code)
error = f"Received an unexpected response from service {name} : {message}"

View File

@ -4,7 +4,6 @@ from tests.spiffworkflow_backend.helpers.base_test import BaseTest
class TestDebugController(BaseTest):
def test_test_raise_error(
self,
app: Flask,