Skip to content

Commit

Permalink
added graceful error handling to workflow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
avneesh-akto committed Apr 16, 2024
1 parent c62e46b commit 6b76963
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,18 @@ public NodeResult processNode(Node node, Map<String, Object> varMap, Boolean all
String apiType = firstChildNode.getValues().toString();
if (apiType.equalsIgnoreCase("get_asset_api")) {
rawApi = memory.findAssetGetterRequest(apiInfoKey);
if (rawApi == null) {
testErrors.add("Couldn't find corresponding getter api");
new WorkflowTestResult.NodeResult("[]",false, testErrors);
}
}
childNodes.remove(0);
} else {
OriginalHttpRequest request = memory.run(apiInfoKey.getApiCollectionId(), apiInfoKey.getUrl(), apiInfoKey.getMethod().name());
if (request == null) {
testErrors.add("Failed getting request from dependency graph");
new WorkflowTestResult.NodeResult("[]",false, testErrors);
}
rawApi.setRequest(request);
}
}
Expand Down

0 comments on commit 6b76963

Please sign in to comment.