cleanup logging

This commit is contained in:
Joel Wetzell
2025-11-20 22:16:04 -06:00
parent f28a9fac99
commit 7792444c3e
4 changed files with 20 additions and 20 deletions

View File

@@ -23,24 +23,24 @@ func init() {
host, ok := params["host"]
if !ok {
return nil, fmt.Errorf("udp client requires a host parameter")
return nil, fmt.Errorf("net.udp.client requires a host parameter")
}
hostString, ok := host.(string)
if !ok {
return nil, fmt.Errorf("udp client host must be uint16")
return nil, fmt.Errorf("net.udp.client host must be uint16")
}
port, ok := params["port"]
if !ok {
return nil, fmt.Errorf("udp client requires a port parameter")
return nil, fmt.Errorf("net.udp.client requires a port parameter")
}
portNum, ok := port.(float64)
if !ok {
return nil, fmt.Errorf("udp client port must be uint16")
return nil, fmt.Errorf("net.udp.client port must be uint16")
}
return &UDPClient{Host: hostString, Port: uint16(portNum), config: config}, nil
@@ -80,7 +80,7 @@ func (uc *UDPClient) Output(payload any) error {
if uc.conn != nil {
payloadBytes, ok := payload.([]byte)
if !ok {
return fmt.Errorf("udp-client is only able to output bytes")
return fmt.Errorf("net.udp.client is only able to output bytes")
}
_, err := uc.conn.Write(payloadBytes)
return err