From b748e6d0ffd9b2151ff8a4fb99c2bec61da7a4ee Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Mon, 27 Sep 2021 10:43:48 +0200 Subject: [PATCH] update error messages --- internal/conf/authmethod.go | 2 +- internal/conf/encryption.go | 2 +- internal/conf/logdestination.go | 2 +- internal/conf/loglevel.go | 2 +- internal/conf/protocol.go | 2 +- internal/conf/sourceprotocol.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/conf/authmethod.go b/internal/conf/authmethod.go index c135cb2a..ff599915 100644 --- a/internal/conf/authmethod.go +++ b/internal/conf/authmethod.go @@ -43,7 +43,7 @@ func (d *AuthMethods) UnmarshalJSON(b []byte) error { *d = append(*d, headers.AuthDigest) default: - return fmt.Errorf("unsupported authentication method: %s", in) + return fmt.Errorf("invalid authentication method: %s", in) } } diff --git a/internal/conf/encryption.go b/internal/conf/encryption.go index 1a82a717..de6bf6d9 100644 --- a/internal/conf/encryption.go +++ b/internal/conf/encryption.go @@ -51,7 +51,7 @@ func (d *Encryption) UnmarshalJSON(b []byte) error { *d = EncryptionStrict default: - return fmt.Errorf("unsupported encryption value: '%s'", in) + return fmt.Errorf("invalid encryption value: '%s'", in) } return nil diff --git a/internal/conf/logdestination.go b/internal/conf/logdestination.go index 2e9ec223..ac21f475 100644 --- a/internal/conf/logdestination.go +++ b/internal/conf/logdestination.go @@ -57,7 +57,7 @@ func (d *LogDestinations) UnmarshalJSON(b []byte) error { (*d)[logger.DestinationSyslog] = struct{}{} default: - return fmt.Errorf("unsupported log destination: %s", proto) + return fmt.Errorf("invalid log destination: %s", proto) } } diff --git a/internal/conf/loglevel.go b/internal/conf/loglevel.go index 6c67762c..a29594ca 100644 --- a/internal/conf/loglevel.go +++ b/internal/conf/loglevel.go @@ -46,7 +46,7 @@ func (d *LogLevel) UnmarshalJSON(b []byte) error { *d = LogLevel(logger.Debug) default: - return fmt.Errorf("unsupported log level: %s", in) + return fmt.Errorf("invalid log level: %s", in) } return nil diff --git a/internal/conf/protocol.go b/internal/conf/protocol.go index f717f2eb..173d18bb 100644 --- a/internal/conf/protocol.go +++ b/internal/conf/protocol.go @@ -63,7 +63,7 @@ func (d *Protocols) UnmarshalJSON(b []byte) error { (*d)[ProtocolTCP] = struct{}{} default: - return fmt.Errorf("unsupported protocol: %s", proto) + return fmt.Errorf("invalid protocol: %s", proto) } } diff --git a/internal/conf/sourceprotocol.go b/internal/conf/sourceprotocol.go index 74d34120..1fb47deb 100644 --- a/internal/conf/sourceprotocol.go +++ b/internal/conf/sourceprotocol.go @@ -57,7 +57,7 @@ func (d *SourceProtocol) UnmarshalJSON(b []byte) error { case "automatic": default: - return fmt.Errorf("unsupported protocol '%s'", in) + return fmt.Errorf("invalid protocol '%s'", in) } return nil