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

mendersoftware / iot-manager / 1336988003

18 Jun 2024 09:38AM UTC coverage: 87.602%. Remained the same
1336988003

Pull #288

gitlab-ci

alfrunes
test(accpetance): Infer Docker compose service name from host

Remove hard-coded host name from config and actually use the `--host`
pytest config.

Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
Pull Request #288: test(accpetance): Infer Docker compose service name from host

3229 of 3686 relevant lines covered (87.6%)

11.46 hits per line

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

28.13
/client/error.go
1
// Copyright 2022 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
package client
16

17
import (
18
        "fmt"
19
)
20

21
type HTTPError interface {
22
        error
23
        Code() int
24
}
25

26
func NewHTTPError(code int) HTTPError {
1✔
27
        return httpError{
1✔
28
                code: code,
1✔
29
        }
1✔
30
}
1✔
31

32
func WrapHTTPError(cause error, code int) HTTPError {
×
33
        return httpErrorWithCause{
×
34
                httpError: httpError{
×
35
                        code: code,
×
36
                },
×
37
                cause: cause,
×
38
        }
×
39
}
×
40

41
type httpError struct {
42
        code int
43
}
44

45
func (err httpError) Code() int {
×
46
        return err.code
×
47
}
×
48

49
func (err httpError) Error() string {
1✔
50
        errMsg := fmt.Sprintf("client: unexpected status code from API: %d", err.code)
1✔
51
        return errMsg
1✔
52
}
1✔
53

54
type httpErrorWithCause struct {
55
        httpError
56
        cause error
57
}
58

59
func (err httpErrorWithCause) Error() string {
×
60
        errMsg := fmt.Sprintf("client: unexpected status code from API: %d", err.code)
×
61
        if err.cause != nil {
×
62
                errMsg += ": " + err.cause.Error()
×
63
        }
×
64
        return errMsg
×
65
}
66

67
func (err httpErrorWithCause) Unwrap() error {
×
68
        return err.cause
×
69
}
×
70

71
func (err httpErrorWithCause) Cause() error {
×
72
        return err.cause
×
73
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc