MCPcopy
hub / github.com/larksuite/cli / wrapBlockError

Function wrapBlockError

internal/output/emit.go:40–49  ·  view source on GitHub ↗

wrapBlockError creates a typed error for content-safety block.

(alert *extcs.Alert)

Source from the content-addressed store, hash-verified

38
39// wrapBlockError creates a typed error for content-safety block.
40func wrapBlockError(alert *extcs.Alert) error {
41 var matchedRules []string
42 if alert != nil {
43 matchedRules = alert.MatchedRules
44 }
45 return errs.NewContentSafetyError(errs.SubtypeContentSafety,
46 "content safety violation detected (rules: %s)", strings.Join(matchedRules, ", ")).
47 WithRules(matchedRules...).
48 WithCause(errBlocked)
49}
50
51// WriteAlertWarning writes a human-readable content-safety warning to w.
52// Used by non-JSON output paths (pretty, table, csv) in warn mode.

Callers 1

ScanForSafetyFunction · 0.85

Calls 3

NewContentSafetyErrorFunction · 0.92
WithRulesMethod · 0.80
WithCauseMethod · 0.45

Tested by

no test coverage detected