• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opendefensecloud / solution-arsenal / 21174958280

20 Jan 2026 02:22PM UTC coverage: 66.89% (-3.9%) from 70.819%
21174958280

Pull #33

github

web-flow
Merge bae3ae4a9 into 4f4db7fd8
Pull Request #33: Adds Discovery API to Solar Core

97 of 166 new or added lines in 3 files covered. (58.43%)

299 of 447 relevant lines covered (66.89%)

1.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/controller/errors.go
1
// Copyright 2026 BWI GmbH and Solution Arsenal contributors
2
// SPDX-License-Identifier: Apache-2.0
3

4
package controller
5

6
import (
7
        "fmt"
8
        "strings"
9

10
        "github.com/go-logr/logr"
11
)
12

13
// errLogAndWrap is a small utility function to reduce code and be able to directly
14
// return errors, but wrap them and log them at the same time. It also capitalizes the
15
// first letter as well. Short texts will be handled.
NEW
16
func errLogAndWrap(log logr.Logger, err error, text string) error {
×
NEW
17
        textLen := len(text)
×
NEW
18
        switch textLen {
×
NEW
19
        case 0:
×
NEW
20
                return err
×
NEW
21
        case 1:
×
NEW
22
                logText := strings.ToUpper(text)
×
NEW
23
                log.Error(err, logText)
×
NEW
24
                return fmt.Errorf(text+": %w", err)
×
NEW
25
        default:
×
NEW
26
                logText := strings.ToUpper(text[:1]) + text[1:]
×
NEW
27
                log.Error(err, logText)
×
NEW
28
                return fmt.Errorf(text+": %w", err)
×
29
        }
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc