Skip to content

CxService.setProjectRepositoryDetails has hard-coded error message #178

@cx-james-bostock

Description

@cx-james-bostock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions