MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / extractErrorCode

Function extractErrorCode

cmd/gosqlx/internal/output/json.go:429–437  ·  view source on GitHub ↗

extractErrorCode extracts the error code from an error

(err error)

Source from the content-addressed store, hash-verified

427
428// extractErrorCode extracts the error code from an error
429func extractErrorCode(err error) string {
430 if err == nil {
431 return ""
432 }
433 if code, ok := goerrors.ExtractErrorCode(err); ok {
434 return string(code)
435 }
436 return ""
437}
438
439// categorizeByCode categorizes errors by error code if available
440func categorizeByCode(code, errMsg string) string {

Callers 2

FormatValidationJSONFunction · 0.70
FormatParseErrorJSONFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected