You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2021/04/29 13:12:28 UTC

[camel-k] 14/30: fix(trait): default error handler configuration setting

This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 68aaeb4ec4e3dc4721e10289e9426b9a5b23b699
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Apr 21 17:25:41 2021 +0200

    fix(trait): default error handler configuration setting
---
 pkg/trait/error_handler.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pkg/trait/error_handler.go b/pkg/trait/error_handler.go
index 2b57738..eadaa70 100644
--- a/pkg/trait/error_handler.go
+++ b/pkg/trait/error_handler.go
@@ -110,7 +110,12 @@ func parseErrorHandler(errorHandlerSpec v1.ErrorHandlerSpec) (string, error) {
 	case "no":
 		return `errorHandler(noErrorHandler());`, nil
 	case "default":
-		return `errorHandler(defaultErrorHandler());`, nil
+		errorHandlerConfiguration, err := parseErrorHandlerConfiguration(errorHandlerSpec.Configuration)
+		if err != nil {
+			return "", err
+		}
+
+		return fmt.Sprintf(`errorHandler(defaultErrorHandler()%v);`, errorHandlerConfiguration), nil
 	case "dead-letter-channel":
 		errorHandlerConfiguration, err := parseErrorHandlerConfiguration(errorHandlerSpec.Configuration)
 		if err != nil {