github.com/m3db/m3@v1.5.0/src/query/errors/storage.go (about)

     1  // Copyright (c) 2018 Uber Technologies, Inc.
     2  //
     3  // Permission is hereby granted, free of charge, to any person obtaining a copy
     4  // of this software and associated documentation files (the "Software"), to deal
     5  // in the Software without restriction, including without limitation the rights
     6  // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     7  // copies of the Software, and to permit persons to whom the Software is
     8  // furnished to do so, subject to the following conditions:
     9  //
    10  // The above copyright notice and this permission notice shall be included in
    11  // all copies or substantial portions of the Software.
    12  //
    13  // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    14  // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    15  // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    16  // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    17  // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    18  // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    19  // THE SOFTWARE.
    20  
    21  package errors
    22  
    23  import (
    24  	"errors"
    25  )
    26  
    27  var (
    28  	// ErrNilWriteQuery is returned when trying to write a nil query.
    29  	ErrNilWriteQuery = errors.New("nil write query")
    30  
    31  	// ErrRemoteWriteQuery is returned when trying to write to a remote
    32  	// endpoint query.
    33  	ErrRemoteWriteQuery = errors.New("cannot write to remote endpoint")
    34  
    35  	// ErrNotImplemented is returned when the storage endpoint is not implemented.
    36  	ErrNotImplemented = errors.New("not implemented")
    37  
    38  	// ErrInvalidFetchResponse is returned when fetch fails from storage.
    39  	ErrInvalidFetchResponse = errors.New("invalid response from fetch")
    40  
    41  	// ErrFetchResponseOrder is returned fetch responses are not in order.
    42  	ErrFetchResponseOrder = errors.New("responses out of order for fetch")
    43  
    44  	// ErrFetchRequestType is an error returned when response from fetch has
    45  	// an invalid type.
    46  	ErrFetchRequestType = errors.New("invalid request type")
    47  
    48  	// ErrNoValidResults is an error returned when there are no stores
    49  	// that succeeded the fanout.
    50  	ErrNoValidResults = errors.New("no valid results in fanout")
    51  
    52  	// ErrInvalidFetchResult is an error returned when fetch result is invalid.
    53  	ErrInvalidFetchResult = errors.New("invalid fetch result")
    54  
    55  	// ErrZeroInterval is an error returned when fetch interval is 0.
    56  	ErrZeroInterval = errors.New("interval cannot be 0")
    57  
    58  	// ErrInvalidOperation is an error returned when fetch raw is called on wrong
    59  	// storage type.
    60  	ErrInvalidOperation = errors.New("can only fetch raw iterators on" +
    61  		" local storage")
    62  
    63  	// ErrBadRequestType is an error returned when a request type is unexpected.
    64  	ErrBadRequestType = errors.New("request is an invalid type")
    65  
    66  	// ErrCannotDecodeCompressedTags is an error returned when compressed
    67  	// tags cannot be decoded.
    68  	ErrCannotDecodeCompressedTags = errors.New("unable to decode compressed tags")
    69  
    70  	// ErrCannotDecodeDecompressedTags is an error returned when decompressed
    71  	// tags cannot be decoded.
    72  	ErrCannotDecodeDecompressedTags = errors.New("unable to decode" +
    73  		" decompressed tags")
    74  
    75  	// ErrCannotEncodeCompressedTags is an error returned when compressed tags
    76  	// cannot be encoded.
    77  	ErrCannotEncodeCompressedTags = errors.New("unable to encode compressed tags")
    78  
    79  	// ErrOnlyFixedResSupported is an error returned we try to get step size
    80  	// for variable resolution.
    81  	ErrOnlyFixedResSupported = errors.New("only fixed resolution supported")
    82  
    83  	// ErrUnexpectedGRPCResponseType is an error returned when rpc response type
    84  	// is unhandled.
    85  	ErrUnexpectedGRPCResponseType = errors.New("unexpected grpc response type")
    86  
    87  	// ErrInconsistentCompleteTagsType is an error returned when a complete tags
    88  	// request returns an inconsistenent type.
    89  	ErrInconsistentCompleteTagsType = errors.New("inconsistent complete tags" +
    90  		" response type")
    91  )