Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/grafana-agent
Path: blob/main/pkg/metrics/instance/configstore/errors.go
5308 views
1
package configstore
2
3
import "fmt"
4
5
// ErrNotConnected is used when a store operation was called but no connection
6
// to the store was active.
7
var ErrNotConnected = fmt.Errorf("not connected to store")
8
9
// NotExistError is used when a config doesn't exist.
10
type NotExistError struct {
11
Key string
12
}
13
14
// Error implements error.
15
func (e NotExistError) Error() string {
16
return fmt.Sprintf("configuration %s does not exist", e.Key)
17
}
18
19
// NotUniqueError is used when two scrape jobs have the same name.
20
type NotUniqueError struct {
21
ScrapeJob string
22
}
23
24
// Error implements error.
25
func (e NotUniqueError) Error() string {
26
return fmt.Sprintf("found multiple scrape configs in config store with job name %q", e.ScrapeJob)
27
}
28
29