From 6b178d1ae440b735465353a7cf84758695cef592 Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Mon, 9 Feb 2026 19:15:34 -0600 Subject: [PATCH] cleanup error messages --- internal/module/http-server.go | 2 +- internal/module/mqtt-client.go | 6 +++--- internal/module/nats-client.go | 4 ++-- internal/module/tcp-client.go | 2 +- internal/module/time-interval.go | 2 +- internal/processor/time-sleep.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/module/http-server.go b/internal/module/http-server.go index df0b979..3f7db7d 100644 --- a/internal/module/http-server.go +++ b/internal/module/http-server.go @@ -65,7 +65,7 @@ func init() { portNum, ok := port.(float64) if !ok { - return nil, errors.New("http.server port must be uint16") + return nil, errors.New("http.server port must be a number") } return &HTTPServer{Port: uint16(portNum), config: config, logger: CreateLogger(config)}, nil diff --git a/internal/module/mqtt-client.go b/internal/module/mqtt-client.go index 843bc23..0440296 100644 --- a/internal/module/mqtt-client.go +++ b/internal/module/mqtt-client.go @@ -36,7 +36,7 @@ func init() { brokerString, ok := broker.(string) if !ok { - return nil, errors.New("mqtt.client broker must be string") + return nil, errors.New("mqtt.client broker must be a string") } topic, ok := params["topic"] @@ -48,7 +48,7 @@ func init() { topicString, ok := topic.(string) if !ok { - return nil, errors.New("mqtt.client topic must be string") + return nil, errors.New("mqtt.client topic must be a string") } clientId, ok := params["clientId"] @@ -60,7 +60,7 @@ func init() { clientIdString, ok := clientId.(string) if !ok { - return nil, errors.New("mqtt.client clientId must be string") + return nil, errors.New("mqtt.client clientId must be a string") } return &MQTTClient{config: config, Broker: brokerString, Topic: topicString, ClientID: clientIdString, logger: CreateLogger(config)}, nil diff --git a/internal/module/nats-client.go b/internal/module/nats-client.go index a987b60..b01db4e 100644 --- a/internal/module/nats-client.go +++ b/internal/module/nats-client.go @@ -36,7 +36,7 @@ func init() { urlString, ok := url.(string) if !ok { - return nil, errors.New("nats.client url must be string") + return nil, errors.New("nats.client url must be a string") } subject, ok := params["subject"] @@ -48,7 +48,7 @@ func init() { subjectString, ok := subject.(string) if !ok { - return nil, errors.New("nats.client subject must be string") + return nil, errors.New("nats.client subject must be a string") } return &NATSClient{config: config, URL: urlString, Subject: subjectString, logger: CreateLogger(config)}, nil diff --git a/internal/module/tcp-client.go b/internal/module/tcp-client.go index 4049b5f..8c9d049 100644 --- a/internal/module/tcp-client.go +++ b/internal/module/tcp-client.go @@ -38,7 +38,7 @@ func init() { hostString, ok := host.(string) if !ok { - return nil, errors.New("net.tcp.client host must be string") + return nil, errors.New("net.tcp.client host must be a string") } port, ok := params["port"] diff --git a/internal/module/time-interval.go b/internal/module/time-interval.go index 0b06f33..058048f 100644 --- a/internal/module/time-interval.go +++ b/internal/module/time-interval.go @@ -34,7 +34,7 @@ func init() { durationNum, ok := duration.(float64) if !ok { - return nil, errors.New("time.interval duration must be number") + return nil, errors.New("time.interval duration must be a number") } return &TimeInterval{Duration: uint32(durationNum), config: config, logger: CreateLogger(config)}, nil }, diff --git a/internal/processor/time-sleep.go b/internal/processor/time-sleep.go index 4e8583c..2676eec 100644 --- a/internal/processor/time-sleep.go +++ b/internal/processor/time-sleep.go @@ -36,7 +36,7 @@ func init() { durationNum, ok := duration.(float64) if !ok { - return nil, errors.New("time.sleep duration must be number") + return nil, errors.New("time.sleep duration must be a number") } return &MetaDelay{config: config, Duration: time.Millisecond * time.Duration(durationNum)}, nil