MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / errorDocsURL

Method errorDocsURL

logger/formatter_common.go:125–133  ·  view source on GitHub ↗

errorDocsURL checks if the error value implements [errctx.Error] and has a non-empty DocsURL. If so, it returns a slog.Attr containing the docs URL; otherwise, it returns nil.

()

Source from the content-addressed store, hash-verified

123// errorDocsURL checks if the error value implements [errctx.Error] and has a non-empty DocsURL.
124// If so, it returns a slog.Attr containing the docs URL; otherwise, it returns nil.
125func (s *formatterCommon) errorDocsURL() *slog.Attr {
126 if v, ok := s.error.Value.Any().(errctx.Error); ok {
127 if url := v.DocsURL(); url != "" {
128 return &slog.Attr{Key: s.error.Key + "_docs_url", Value: slog.StringValue(url)}
129 }
130 }
131
132 return nil
133}

Callers 3

formatMethod · 0.80
formatMethod · 0.80
formatMethod · 0.80

Calls 1

DocsURLMethod · 0.65

Tested by

no test coverage detected