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

lightningnetwork / lnd / 17132206455

21 Aug 2025 03:56PM UTC coverage: 54.685% (-2.6%) from 57.321%
17132206455

Pull #10167

github

web-flow
Merge 5dd2ed093 into 0c2f045f5
Pull Request #10167: multi: bump Go to 1.24.6

4 of 31 new or added lines in 10 files covered. (12.9%)

23854 existing lines in 284 files now uncovered.

108937 of 199210 relevant lines covered (54.68%)

22026.48 hits per line

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

78.95
/graph/errors.go
1
package graph
2

3
import (
4
        "fmt"
5
)
6

7
// ErrorCode is used to represent the various errors that can occur within this
8
// package.
9
type ErrorCode uint8
10

11
const (
12
        // ErrOutdated is returned when the routing update already have
13
        // been applied, or a newer update is already known.
14
        ErrOutdated ErrorCode = iota
15

16
        // ErrIgnored is returned when the update have been ignored because
17
        // this update can't bring us something new, or because a node
18
        // announcement was given for node not found in any channel.
19
        ErrIgnored
20
)
21

22
// Error is a structure that represent the error inside the graph package,
23
// this structure carries additional information about error code in order to
24
// be able distinguish errors outside of the current package.
25
type Error struct {
26
        err  error
27
        code ErrorCode
28
}
29

30
// Error represents errors as the string
31
// NOTE: Part of the error interface.
UNCOV
32
func (e *Error) Error() string {
×
UNCOV
33
        return e.err.Error()
×
UNCOV
34
}
×
35

36
// A compile time check to ensure Error implements the error interface.
37
var _ error = (*Error)(nil)
38

39
// NewErrf creates a Error by the given error formatted description and
40
// its corresponding error code.
41
func NewErrf(code ErrorCode, format string, a ...interface{}) *Error {
3✔
42
        return &Error{
3✔
43
                code: code,
3✔
44
                err:  fmt.Errorf(format, a...),
3✔
45
        }
3✔
46
}
3✔
47

48
// IsError is a helper function which is needed to have ability to check that
49
// returned error has specific error code.
50
func IsError(e interface{}, codes ...ErrorCode) bool {
5✔
51
        err, ok := e.(*Error)
5✔
52
        if !ok {
6✔
53
                return false
1✔
54
        }
1✔
55

56
        for _, code := range codes {
8✔
57
                if err.code == code {
8✔
58
                        return true
4✔
59
                }
4✔
60
        }
61

62
        return false
×
63
}
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