Skip to content

Commit

Permalink
Merge pull request #9 from CheckmarxDev/initial-code
Browse files Browse the repository at this point in the history
IG-009 Change error messages
  • Loading branch information
ittaigilat-cx authored Aug 6, 2024
2 parents 01b804f + 6b86c29 commit 9598b2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions prompts/sast_result_remediation/build-prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ func BuildPrompt(resultsFile string, resultId string, sourcePath string) (system
err = nil
results, err := ReadResultsSAST(resultsFile)
if err != nil {
return system, user, fmt.Errorf("Error '%v' reading results file '%s': ", err, resultsFile)
return system, user, fmt.Errorf("Error reading and parsing SAST results file '%s': '%v'", resultsFile, err)
}
result, err := GetResultByID(results, resultId)
if err != nil {
return system, user, fmt.Errorf("Error '%v' getting result by ID '%s': ", err, resultId)
return system, user, fmt.Errorf("Error getting result for result ID '%s': '%v'", resultId, err)
}
sources, err := GetSourcesForResult(result, sourcePath)
if err != nil {
return system, user, fmt.Errorf("Error '%v' getting sources for result ID '%s': ", err, resultId)
return system, user, fmt.Errorf("Error getting sources for result ID '%s': '%v'", resultId, err)
}

system = GetSystemPrompt()
user, err = CreateUserPrompt(result, sources)
if err != nil {
return "", user, fmt.Errorf("Error '%v' creating user prompt for result ID '%s': ", err, resultId)
return "", user, fmt.Errorf("Error creating prompt for result ID '%s': '%v'", resultId, err)
}

return system, user, err
Expand Down

0 comments on commit 9598b2e

Please sign in to comment.