errors

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Package errors provides error types and function

Index

Constants

This section is empty.

Variables

View Source
var (

	// Cassandra
	ErrCassandraInvalidConsistencyType = func(consistency string) error {
		return Errorf("consistetncy type %q is not defined", consistency)
	}

	NewErrCassandraNotFoundIdentity = func() error {
		return &ErrCassandraNotFoundIdentity{
			err: New("error cassandra entry not found"),
		}
	}

	ErrCassandraNotFound = func(key string) error {
		return Wrapf(NewErrCassandraNotFoundIdentity(), "error cassandra key '%s' not found", key)
	}

	ErrCassandraGetOperationFailed = func(key string, err error) error {
		return Wrapf(err, "Failed to fetch key (%s)", key)
	}

	ErrCassandraSetOperationFailed = func(key string, err error) error {
		return Wrapf(err, "Failed to set key (%s)", key)
	}

	ErrCassandraDeleteOperationFailed = func(key string, err error) error {
		return Wrapf(err, "Failed to delete key (%s)", key)
	}
)
View Source
var (
	// internal compressor
	ErrInvalidCompressionLevel = func(level int) error {
		return Errorf("invalid compression level: %d", level)
	}

	// Compressor
	ErrCompressorNameNotFound = func(name string) error {
		return Errorf("compressor %s not found", name)
	}

	ErrCompressedDataNotFound = New("compressed data not found")

	ErrDecompressedDataNotFound = New("decompressed data not found")

	ErrCompressFailed = New("compress failed")

	ErrDecompressFailed = New("decompress failed")
)
View Source
var (
	ErrAddrCouldNotDiscover = func(err error, record string) error {
		return Wrapf(err, "addr %s ip couldn't discover", record)
	}

	ErrNodeNotFound = func(node string) error {
		return Errorf("discover node %s not found", node)
	}

	ErrNamespaceNotFound = func(ns string) error {
		return Errorf("discover namespace %s not found", ns)
	}

	ErrPodNameNotFound = func(name string) error {
		return Errorf("discover pod %s not found", name)
	}

	ErrInvalidDiscoveryCache = New("cache type cast failed")
)
View Source
var (
	ErrTimeoutParseFailed = func(timeout string) error {
		return Errorf("invalid timeout value: %s\t:timeout parse error out put failed", timeout)
	}

	ErrServerNotFound = func(name string) error {
		return Errorf("server %s not found", name)
	}

	ErrOptionFailed = func(err error, ref reflect.Value) error {
		return Wrapf(err, "failed to setup option :\t%s",
			runtime.FuncForPC(ref.Pointer()).Name())
	}

	ErrArgumentParseFailed = func(err error) error {
		return Wrap(err, "argument parse failed")
	}

	ErrBackoffTimeout = func(err error) error {
		return Wrap(err, "backoff timeout by limitation")
	}

	ErrInvalidTypeConversion = func(i interface{}, tgt interface{}) error {
		return Errorf("invalid type conversion %v to %v", reflect.TypeOf(i), reflect.TypeOf(tgt))
	}

	ErrLoggingRetry = func(err error, ref reflect.Value) error {
		return Wrapf(err, "failed to output %s logs, retrying...",
			runtime.FuncForPC(ref.Pointer()).Name())
	}

	ErrLoggingFailed = func(err error, ref reflect.Value) error {
		return Wrapf(err, "failed to output %s logs",
			runtime.FuncForPC(ref.Pointer()).Name())
	}

	New = func(msg string) error {
		if msg == "" {
			return nil
		}
		return errors.New(msg)
	}

	Wrap = func(err error, msg string) error {
		if err != nil {
			if msg != "" {
				return errors.Wrap(err, msg)
			}
			return err
		}
		return New(msg)
	}

	Wrapf = func(err error, format string, args ...interface{}) error {
		if err != nil {
			if format != "" && len(args) > 0 {
				return errors.Wrapf(err, format, args...)
			}
			return err
		}
		return Errorf(format, args...)
	}

	Cause = func(err error) error {
		if err != nil {
			return errors.Cause(err)
		}
		return nil
	}

	Errorf = func(format string, args ...interface{}) error {
		if format != "" && args != nil && len(args) > 0 {
			return errors.Errorf(format, args...)
		}
		return nil
	}

	As         = errors.As
	Is         = errors.Is
	UnWrapOnce = errbase.UnwrapOnce
	UnWrapAll  = errbase.UnwrapAll
)
View Source
var (
	ErrgRPCClientConnectionClose = func(name string, err error) error {
		return Wrapf(err, "%s's gRPC connection close error", name)
	}

	ErrInvalidGRPCClientConn = func(addr string) error {
		return Errorf("invalid gRPC client connection to %s", addr)
	}

	ErrGRPCClientNotFound = New("vald internal gRPC client not found")

	ErrGRPCClientConnNotFound = func(addr string) error {
		return Errorf("gRPC client connection not found in %s", addr)
	}

	ErrRPCCallFailed = func(addr string, err error) error {
		return Wrapf(err, "addr: %s", addr)
	}

	ErrGRPCTargetAddrNotFound = New("grpc connection target not found")
)
View Source
var (
	ErrInvalidAPIConfig = New("invalid api config")

	ErrInvalidRequest = New("invalid request")

	ErrHandler = func(err error) error {
		return Wrap(err, "handler returned error")
	}

	ErrHandlerTimeout = func(err error, t time.Time) error {
		return Wrapf(err, "handler timeout %v", t)
	}

	ErrRequestBodyCloseAndFlush = func(err error) error {
		return Wrap(err, "request body flush & close failed")
	}

	ErrRequestBodyClose = func(err error) error {
		return Wrap(err, "request body close failed")
	}

	ErrRequestBodyFlush = func(err error) error {
		return Wrap(err, "request body flush failed")
	}

	ErrTransportRetryable = New("transport is retryable")
)
View Source
var (
	// MySQL
	ErrMySQLConnectionPingFailed = New("error MySQL connection ping failed")

	NewErrMySQLNotFoundIdentity = func() error {
		return &ErrMySQLNotFoundIdentity{
			err: New("error mysql element not found"),
		}
	}

	ErrMySQLConnectionClosed = New("error MySQL connection closed")

	ErrRequiredElementNotFoundByUUID = func(uuid string) error {
		return Wrapf(NewErrMySQLNotFoundIdentity(), "error required element not found, uuid: %s", uuid)
	}

	NewErrMySQLInvalidArgumentIdentity = func() error {
		return &ErrMySQLInvalidArgumentIdentity{
			err: New("error mysql invalid argument"),
		}
	}

	ErrRequiredMemberNotFilled = func(member string) error {
		return Wrapf(NewErrMySQLInvalidArgumentIdentity(), "error required member not filled (member: %s)", member)
	}
)
View Source
var (
	ErrCreateProperty = func(err error) error {
		return Wrap(err, "failed to create property")
	}

	ErrIndexNotFound = New("index file not found")

	ErrDimensionLimitExceed = func(current, limit int) error {
		return Errorf("supported dimension limit exceed:\trequired = %d,\tlimit = %d", current, limit)
	}

	ErrUnsupportedObjectType = New("unsupported ObjectType")

	ErrUnsupportedDistanceType = New("unsupported DistanceType")

	ErrFailedToSetDistanceType = func(err error, distance string) error {
		return Wrap(err, "failed to set distance type "+distance)
	}

	ErrFailedToSetObjectType = func(err error, t string) error {
		return Wrap(err, "failed to set object type "+t)
	}

	ErrFailedToSetDimension = func(err error) error {
		return Wrap(err, "failed to set dimension")
	}

	ErrFailedToSetCreationEdgeSize = func(err error) error {
		return Wrap(err, "failed to set creation edge size")
	}

	ErrFailedToSetSearchEdgeSize = func(err error) error {
		return Wrap(err, "failed to set search edge size")
	}

	ErrUncommittedIndexExists = func(num uint64) error {
		return Errorf("%d indexes are not committed", num)
	}

	ErrUncommittedIndexNotFound = New("uncommitted indexes are not found")

	// ErrCAPINotImplemented raises using not implemented function in C API
	ErrCAPINotImplemented = New("not implemented in C API")

	ErrUUIDAlreadyExists = func(uuid string, oid uint) error {
		return Errorf("ngt uuid %s object id %d already exists ", uuid, oid)
	}

	ErrUUIDNotFound = func(id uint32) error {
		if id == 0 {
			return Errorf("ngt object uuid not found", id)
		}
		return Errorf("ngt object uuid %d's metadata not found", id)
	}

	ErrObjectIDNotFound = func(uuid string) error {
		return Errorf("ngt uuid %s's object id not found", uuid)
	}

	ErrObjectNotFound = func(err error, uuid string) error {
		return Wrapf(err, "ngt uuid %s's object not found", uuid)
	}

	ErrRemoveRequestedBeforeIndexing = func(oid uint) error {
		return Errorf("object id %d is not indexed we cannot remove it", oid)
	}
)
View Source
var (

	// Redis
	ErrRedisInvalidKVVKPrefix = func(kv, vk string) error {
		return Errorf("kv index and vk prefix must be defferent.\t(kv: %s,\tvk: %s)", kv, vk)
	}

	NewErrRedisNotFoundIdentity = func() error {
		return &ErrRedisNotFoundIdentity{
			err: New("error redis entry not found"),
		}
	}

	ErrRedisNotFound = func(key string) error {
		return Wrapf(NewErrRedisNotFoundIdentity(), "error redis key '%s' not found", key)
	}

	ErrRedisGetOperationFailed = func(key string, err error) error {
		return Wrapf(err, "Failed to fetch key (%s)", key)
	}

	ErrRedisSetOperationFailed = func(key string, err error) error {
		return Wrapf(err, "Failed to set key (%s)", key)
	}

	ErrRedisDeleteOperationFailed = func(key string, err error) error {
		return Wrapf(err, "Failed to delete key (%s)", key)
	}

	ErrInvalidConfigVersion = func(cur, con string) error {
		return Errorf("invalid config version %s not satisfies version constraints %s", cur, con)
	}

	ErrRedisAddrsNotFound = New("addrs not found")

	ErrRedisConnectionPingFailed = New("error Redis connection ping failed")
)
View Source
var (
	ErrDaemonStartFailed = func(err error) error {
		return Wrap(err, "failed to start daemon")
	}

	ErrDaemonStopFailed = func(err error) error {
		return Wrap(err, "failed to stop daemon")
	}

	ErrStartFunc = func(name string, err error) error {
		return Wrapf(err, "error occured in runner.Start at %s", name)
	}

	ErrPreStopFunc = func(name string, err error) error {
		return Wrapf(err, "error occured in runner.PreStop at %s", name)
	}

	ErrStopFunc = func(name string, err error) error {
		return Wrapf(err, "error occured in runner.Stop at %s", name)
	}

	ErrPostStopFunc = func(name string, err error) error {
		return Wrapf(err, "error occured in runner.PostStop at %s", name)
	}

	ErrRunnerWait = func(name string, err error) error {
		return Wrapf(err, "error occured in runner.Wait at %s", name)
	}
)
View Source
var (
	ErrPanicRecovered = func(err error, rec interface{}) error {
		return Wrap(err, Errorf("panic recovered: %v", rec).Error())
	}

	ErrPanicString = func(err error, msg string) error {
		return Wrap(err, Errorf("panic recovered: %v", msg).Error())
	}

	ErrRuntimeError = func(err error, r runtime.Error) error {
		return Wrap(err, Errorf("system paniced caused by runtime error: %v", r).Error())
	}
)
View Source
var (

	// ErrTLSDisabled is error variable, it's replesents config error that tls is disabled by config
	ErrTLSDisabled = New("tls feature is disabled")

	// ErrTLSCertOrKeyNotFound is error variable, it's replesents tls cert or key not found error
	ErrTLSCertOrKeyNotFound = New("cert or key file path not found")

	ErrCertificationFailed = New("certification failed")
)
View Source
var (
	ErrCollectorNotFound = func() error {
		return New("observability.collector not found")
	}
)
View Source
var (
	ErrFailedToCastTF = func(v interface{}) error {
		return Errorf("failed to cast tensorflow result %+v", v)
	}
)
View Source
var (
	ErrInvalidBackupConfig = New("invalid backup config")
)
View Source
var (
	ErrInvalidCacherType = New("invalid cacher type")
)
View Source
var (
	ErrInvalidMetaDataConfig = New("invalid metadata config")
)
View Source
var (
	ErrInvalidReconcilerConfig = New("invalid reconciler config")
)
View Source
var (
	ErrMetaDataAlreadyExists = func(meta, uuid string) error {
		return Errorf("vald metadata:\t%s\tuuid:\t%s\talready exists ", meta, uuid)
	}
)

Functions

func IsErrCassandraNotFound

func IsErrCassandraNotFound(err error) bool

func IsErrMySQLInvalidArgument

func IsErrMySQLInvalidArgument(err error) bool

func IsErrMySQLNotFound

func IsErrMySQLNotFound(err error) bool

func IsErrRedisNotFound

func IsErrRedisNotFound(err error) bool

Types

type ErrCassandraNotFoundIdentity

type ErrCassandraNotFoundIdentity struct {
	// contains filtered or unexported fields
}

func (*ErrCassandraNotFoundIdentity) Error

type ErrMySQLInvalidArgumentIdentity

type ErrMySQLInvalidArgumentIdentity struct {
	// contains filtered or unexported fields
}

func (*ErrMySQLInvalidArgumentIdentity) Error

type ErrMySQLNotFoundIdentity

type ErrMySQLNotFoundIdentity struct {
	// contains filtered or unexported fields
}

func (*ErrMySQLNotFoundIdentity) Error

func (e *ErrMySQLNotFoundIdentity) Error() string

type ErrRedisNotFoundIdentity

type ErrRedisNotFoundIdentity struct {
	// contains filtered or unexported fields
}

func (*ErrRedisNotFoundIdentity) Error

func (e *ErrRedisNotFoundIdentity) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL