Address PR feedback

pull/10616/head
Edd Robinson 2018-11-29 17:22:49 +00:00
parent d51a3f9b32
commit 186e0392ed
6 changed files with 13 additions and 13 deletions

View File

@ -1338,10 +1338,10 @@ func NewMockClient(code int, body []byte, headers http.Header, err error) *MockC
func (c *MockClient) Do(URL *url.URL, path, method string, authorizer influx.Authorizer, params map[string]string, body io.Reader) (*http.Response, error) {
if c == nil {
return nil, fmt.Errorf("nIL MockClient")
return nil, fmt.Errorf("nil MockClient")
}
if URL == nil {
return nil, fmt.Errorf("nIL url")
return nil, fmt.Errorf("nil url")
}
if c.Err != nil {
return nil, c.Err

View File

@ -102,7 +102,7 @@ func (s *SourceProxyQueryService) fluxQuery(ctx context.Context, w io.Writer, re
func (s *SourceProxyQueryService) influxQuery(ctx context.Context, w io.Writer, req *query.ProxyRequest) (int64, error) {
if len(s.URL) == 0 {
return 0, fmt.Errorf("uRL from source cannot be empty if the compiler type is influxql")
return 0, fmt.Errorf("URL from source cannot be empty if the compiler type is influxql")
}
u, err := newURL(s.URL, "/query")

View File

@ -1378,7 +1378,7 @@ func pointKey(measurement string, tags Tags, fields Fields, t time.Time) ([]byte
return nil, fmt.Errorf("+/-Inf is an unsupported value for field %s", key)
}
if math.IsNaN(value) {
return nil, fmt.Errorf("naN is an unsupported value for field %s", key)
return nil, fmt.Errorf("NAN is an unsupported value for field %s", key)
}
case float32:
// Ensure the caller validates and handles invalid field values
@ -1386,7 +1386,7 @@ func pointKey(measurement string, tags Tags, fields Fields, t time.Time) ([]byte
return nil, fmt.Errorf("+/-Inf is an unsupported value for field %s", key)
}
if math.IsNaN(float64(value)) {
return nil, fmt.Errorf("naN is an unsupported value for field %s", key)
return nil, fmt.Errorf("NAN is an unsupported value for field %s", key)
}
}
if len(key) == 0 {

View File

@ -35,7 +35,7 @@ var ErrDBReadOnly = errors.New("db is read only")
// ErrMaxConcurrency is an error for when the max concurrency is already
// reached for a task when you try to schedule a task.
var ErrMaxConcurrency = errors.New("maxConcurrency reached")
var ErrMaxConcurrency = errors.New("max concurrency reached")
// ErrRunNotFound is an error for when a run isn't found in a FinishRun method.
var ErrRunNotFound = errors.New("run not found")
@ -280,7 +280,7 @@ func (s *Store) UpdateTask(ctx context.Context, req backend.UpdateTaskRequest) (
// ListTasks lists the tasks based on a filter.
func (s *Store) ListTasks(ctx context.Context, params backend.TaskSearchParams) ([]backend.StoreTaskWithMeta, error) {
if params.Org.Valid() && params.User.Valid() {
return nil, errors.New("listTasks: org and user filters are mutually exclusive")
return nil, errors.New("ListTasks: org and user filters are mutually exclusive")
}
const (
@ -288,10 +288,10 @@ func (s *Store) ListTasks(ctx context.Context, params backend.TaskSearchParams)
maxPageSize = 500
)
if params.PageSize < 0 {
return nil, errors.New("listTasks: PageSize must be positive")
return nil, errors.New("ListTasks: PageSize must be positive")
}
if params.PageSize > maxPageSize {
return nil, fmt.Errorf("listTasks: PageSize exceeds maximum of %d", maxPageSize)
return nil, fmt.Errorf("ListTasks: PageSize exceeds maximum of %d", maxPageSize)
}
lim := params.PageSize
if lim == 0 {

View File

@ -131,7 +131,7 @@ func (s *inmem) UpdateTask(_ context.Context, req UpdateTaskRequest) (UpdateTask
func (s *inmem) ListTasks(_ context.Context, params TaskSearchParams) ([]StoreTaskWithMeta, error) {
if params.Org.Valid() && params.User.Valid() {
return nil, errors.New("listTasks: org and user filters are mutually exclusive")
return nil, errors.New("ListTasks: org and user filters are mutually exclusive")
}
const (
@ -140,10 +140,10 @@ func (s *inmem) ListTasks(_ context.Context, params TaskSearchParams) ([]StoreTa
)
if params.PageSize < 0 {
return nil, errors.New("listTasks: PageSize must be positive")
return nil, errors.New("ListTasks: PageSize must be positive")
}
if params.PageSize > maxPageSize {
return nil, fmt.Errorf("listTasks: PageSize exceeds maximum of %d", maxPageSize)
return nil, fmt.Errorf("ListTasks: PageSize exceeds maximum of %d", maxPageSize)
}
lim := params.PageSize

View File

@ -77,7 +77,7 @@ const (
var (
// ErrWALClosed is returned when attempting to write to a closed WAL file.
ErrWALClosed = fmt.Errorf("wAL closed")
ErrWALClosed = fmt.Errorf("WAL closed")
// ErrWALCorrupt is returned when reading a corrupt WAL entry.
ErrWALCorrupt = fmt.Errorf("corrupted WAL entry")