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

Function setErrorHandlerConfiguration

pkg/controller/pipe/error_handler.go:108–122  ·  view source on GitHub ↗
(errorHandlerBinding *bindings.Binding, errorHandler v1.ErrorHandler)

Source from the content-addressed store, hash-verified

106}
107
108func setErrorHandlerConfiguration(errorHandlerBinding *bindings.Binding, errorHandler v1.ErrorHandler) error {
109 properties, err := errorHandler.Configuration()
110 if err != nil {
111 return err
112 }
113 // initialize map if not yet initialized
114 if errorHandlerBinding.ApplicationProperties == nil {
115 errorHandlerBinding.ApplicationProperties = make(map[string]string)
116 }
117 for key, value := range properties {
118 errorHandlerBinding.ApplicationProperties[key] = fmt.Sprintf("%v", value)
119 }
120
121 return nil
122}
123
124// translateCamelErrorHandler will translate a binding as an error handler YAML as expected by Camel.
125func translateCamelErrorHandler(b *bindings.Binding) map[string]any {

Callers 1

maybeErrorHandlerFunction · 0.85

Calls 1

ConfigurationMethod · 0.65

Tested by

no test coverage detected