MCPcopy Create free account
hub / github.com/shipwright-io/build / ToMessage

Method ToMessage

pkg/git/error_parser.go:109–132  ·  view source on GitHub ↗

ToMessage is a function that transforms an error class to an error message

()

Source from the content-addressed store, hash-verified

107
108// ToMessage is a function that transforms an error class to an error message
109func (class ErrorClass) ToMessage() string {
110 switch class {
111 case RepositoryNotFound:
112 return "The source repository does not exist, or you have insufficient permission to access it."
113 case AuthInvalidUserOrPass:
114 return "Basic authentication has failed. Check your username or password. Note: GitHub requires a personal access token instead of your regular password."
115 case AuthPrompted:
116 return "The source repository does not exist, or you have insufficient permission to access it."
117 case RevisionNotFound:
118 return "The remote revision does not exist. Check your revision argument."
119 case AuthInvalidKey:
120 return "The key is invalid for the specified target. Please make sure that the Git repository exists, you have sufficient permissions, and the key is in the right format."
121 case AuthUnexpectedSSH:
122 return "Credential/URL inconsistency: SSH credentials provided, but URL is not a SSH Git URL."
123 case AuthExpectedSSH:
124 return "Credential/URL inconsistency: No SSH credentials provided, but URL is a SSH Git URL."
125 case AuthBasicIncomplete:
126 return "Basic Auth incomplete: Both username and password need to be configured."
127 case AuthUnexpectedHTTP:
128 return "Refusing to continue with basic authentication (username and password) over insecure HTTP connection"
129 }
130
131 return "Git encountered an unknown error."
132}
133
134func (token errorToken) String() string {
135 return token.prefixToken.String() + ": " + token.classToken.String()

Callers 4

extractResultsFromTokensFunction · 0.80
e2e_test.goFile · 0.80
e2e_test.goFile · 0.80
checkCredentialsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected