mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
Merge pull request #4628 from bboreham/fix-storage-error
Make ErrStorage a concrete type not an interface
This commit is contained in:
commit
1f053f897b
|
@ -74,7 +74,7 @@ type (
|
|||
ErrTooManySamples string
|
||||
// ErrStorage is returned if an error was encountered in the storage layer
|
||||
// during query handling.
|
||||
ErrStorage error
|
||||
ErrStorage struct{ error }
|
||||
)
|
||||
|
||||
func (e ErrQueryTimeout) Error() string {
|
||||
|
@ -86,6 +86,9 @@ func (e ErrQueryCanceled) Error() string {
|
|||
func (e ErrTooManySamples) Error() string {
|
||||
return fmt.Sprintf("query processing would load too many samples into memory in %s", string(e))
|
||||
}
|
||||
func (e ErrStorage) Error() string {
|
||||
return e.error.Error()
|
||||
}
|
||||
|
||||
// A Query is derived from an a raw query string and can be run against an engine
|
||||
// it is associated with.
|
||||
|
|
|
@ -193,7 +193,7 @@ func TestQueryError(t *testing.T) {
|
|||
Timeout: 10 * time.Second,
|
||||
}
|
||||
engine := NewEngine(opts)
|
||||
errStorage := ErrStorage(fmt.Errorf("storage error"))
|
||||
errStorage := ErrStorage{fmt.Errorf("storage error")}
|
||||
queryable := storage.QueryableFunc(func(ctx context.Context, mint, maxt int64) (storage.Querier, error) {
|
||||
return &errQuerier{err: errStorage}, nil
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue