MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Error

Method Error

tools/mage/headers.go:164–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162type errorSlice []error
163
164func (errs errorSlice) Error() string {
165 switch len(errs) {
166 case 0:
167 return ""
168 case 1:
169 // Return the formatted error string for a single error.
170 return formatErrorForGitHub(errs[0])
171 default:
172 var b strings.Builder
173 b.WriteString("multiple errors:\n")
174 for _, err := range errs {
175 formattedError := formatErrorForGitHub(err)
176 b.WriteString(formattedError + "\n")
177 }
178 return b.String()
179 }
180}
181
182// formatErrorForGitHub formats an error for GitHub annotations.
183func formatErrorForGitHub(err error) string {

Callers

nothing calls this directly

Calls 2

formatErrorForGitHubFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected