MCPcopy Create free account
hub / github.com/apache/camel-k / parseErrorHandlerByType

Function parseErrorHandlerByType

pkg/cmd/bind.go:318–329  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

316}
317
318func parseErrorHandlerByType(value string) (string, string, error) {
319 errHandlSplit := strings.SplitN(value, ":", 2)
320 if (errHandlSplit[0] == "sink") && len(errHandlSplit) != 2 {
321 return "", "", fmt.Errorf("invalid error handler syntax. Type %s needs a configuration (ie %s:value)",
322 errHandlSplit[0], errHandlSplit[0])
323 }
324 if len(errHandlSplit) > 1 {
325 return errHandlSplit[0], errHandlSplit[1], nil
326 }
327
328 return errHandlSplit[0], "", nil
329}
330
331func (o *bindCmdOptions) decode(res string, key string) (v1.Endpoint, error) {
332 refConverter := reference.NewConverter(reference.KameletPrefix)

Callers 1

parseErrorHandlerMethod · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected