MCPcopy Create free account
hub / github.com/github/gh-aw / FormatErrorWithSuggestions

Function FormatErrorWithSuggestions

pkg/console/render.go:765–777  ·  view source on GitHub ↗

FormatErrorWithSuggestions formats an error message with actionable suggestions

(message string, suggestions []string)

Source from the content-addressed store, hash-verified

763
764// FormatErrorWithSuggestions formats an error message with actionable suggestions
765func FormatErrorWithSuggestions(message string, suggestions []string) string {
766 var output strings.Builder
767 output.WriteString(FormatErrorMessage(message))
768
769 if len(suggestions) > 0 {
770 output.WriteString("\n\nSuggestions:\n")
771 for _, suggestion := range suggestions {
772 output.WriteString(" • " + suggestion + "\n")
773 }
774 }
775
776 return output.String()
777}
778
779// findWordEnd finds the end of a word starting at the given position
780func findWordEnd(line string, start int) int {

Callers 15

NewLogsCommandFunction · 0.92
toggleWorkflowsByNamesFunction · 0.92
fetchPRHeadSHAFunction · 0.92
classifyGHAPIErrorFunction · 0.92
validateRemoteWorkflowFunction · 0.92
RunWorkflowOnGitHubFunction · 0.92
ResolveWorkflowPathFunction · 0.92
getAuditCommandOptionsFunction · 0.92
resolveAuditCommandArgsFunction · 0.92
getWorkflowStatusFunction · 0.92
resolveWorkflowFileInDirFunction · 0.92

Calls 2

FormatErrorMessageFunction · 0.70
StringMethod · 0.45