MCPcopy Create free account
hub / github.com/basecamp/hey-cli / normalizeCobraError

Function normalizeCobraError

internal/cmd/root.go:214–223  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

212}
213
214func normalizeCobraError(err error) error {
215 var e *output.Error
216 if errors.As(err, &e) {
217 return err
218 }
219 if isCobraParseError(err) {
220 return output.ErrUsageHint(err.Error(), "Run 'hey --help' for usage information")
221 }
222 return err
223}
224
225func isCobraParseError(err error) bool {
226 msg := err.Error()

Callers 1

ExecuteFunction · 0.85

Calls 2

isCobraParseErrorFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected