Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CxService.setProjectRepositoryDetails has hard-coded error message #178

Open
james-bostock-cx opened this issue Nov 10, 2021 · 0 comments
Open

Comments

@james-bostock-cx
Copy link
Contributor

The setProjectRepositoryDetails method (in the CxService class) has a hard-coded error message for when the request fails:

        try {
            log.info("Updating Source details for project Id {}", projectId);
            restTemplate.exchange(cxProperties.getUrl().concat(PROJECT_SOURCE), HttpMethod.POST, requestEntity, String.class, projectId);
        } catch (HttpStatusCodeException e) {
            log.error("Error occurred while updating Project source info for project {}.", projectId);
            throw new CheckmarxException("Error occurred while adding source details to project.  Please ensure GIT is defined within Checkmarx");
        }

This should be changed to report the error message from the response body. For example, given the following response:

{
    "messageCode": 12331,
    "messageDetails": "Failure occurred during GIT Browsing"
}

CxFlow should report the messageDetails (and, possibly, the messageCode) in the log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant