mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-17 06:52:26 +02:00
* simplify GetItemByPath * hub: sort version numbers by semver * replace golang.org/x/mod/semver with github.com/Masterminds/semver/v3 (would not compare correctly) * fix nil dereference with tainted items * update tests for collections, postoverflows * fix nil deref * don't fallback to master if hub is not found, improve message * explicit message for unknown version / tainted collections
21 lines
642 B
Go
21 lines
642 B
Go
package cwhub
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
)
|
|
|
|
var (
|
|
// ErrNilRemoteHub is returned when the remote hub configuration is not provided to the NewHub constructor.
|
|
// All attempts to download index or items will return this error.
|
|
ErrNilRemoteHub = errors.New("remote hub configuration is not provided. Please report this issue to the developers")
|
|
)
|
|
|
|
type IndexNotFoundError struct {
|
|
URL string
|
|
Branch string
|
|
}
|
|
|
|
func (e IndexNotFoundError) Error() string {
|
|
return fmt.Sprintf("index not found at %s, branch '%s'. Please check the .cscli.hub_branch value if you specified it in config.yaml, or use 'master' if not sure", e.URL, e.Branch)
|
|
}
|