Newer
Older
// ErrNilClient implements the Error interface and is called if a GNMI Client is nil.
func (e *ErrNilClient) Error() string {
return fmt.Sprintf("client cannot be nil")
// ErrNil implements the Error interface and is called if a struct is nil.
type ErrNil struct {
}
func (e *ErrNil) Error() string {
return fmt.Sprintf("struct cannot be nil")
}
// ErrNotFound implements the Error interface and is called if a specific ID
// of a storable item could not be found.
type ErrNotFound struct {
func (e *ErrNotFound) Error() string {
return fmt.Sprintf("%v not found", e.id)
}
// ErrAlreadyExists implements the Error interface and is called if a specific ID
// of a storable item already exists.
type ErrAlreadyExists struct {
item interface{}
}
func (e *ErrAlreadyExists) Error() string {
return fmt.Sprintf("%v already exists", e.item)
// ErrInvalidTypeAssertion implements the Error interface and is called if the
// type of a storable item does not correspond to the expected type.
type ErrInvalidTypeAssertion struct {
v interface{}
t interface{}
}
func (e ErrInvalidTypeAssertion) Error() string {
return fmt.Sprintf("%v does not implement %v", e.v, e.t)
}
// ErrUnsupportedPath implements the Error interface and is called if the
// given path is not supported.
type ErrUnsupportedPath struct {
p interface{}
}
func (e ErrUnsupportedPath) Error() string {
return fmt.Sprintf("path %v is not supported", e.p)
}
// ErrNotYetImplemented implements the Error interface and is called if a function
// is not implemented yet.
type ErrNotYetImplemented struct{}
func (e ErrNotYetImplemented) Error() string {
return fmt.Sprintf("function not yet implemented")
}
// ErrInvalidParameters implements the Error interface and is called if the wrong
// or no parameters have been provided.
type ErrInvalidParameters struct {
f interface{}
r interface{}
}
func (e ErrInvalidParameters) Error() string {
return fmt.Sprintf("invalid parameters for %v: %v", e.f, e.r)
}
// ErrInvalidTransportOptions implements the Error interface and is called if the
// wrong TransportOptions have been provided.
type ErrInvalidTransportOptions struct {
t interface{}
}
func (e ErrInvalidTransportOptions) Error() string {
return fmt.Sprintf("invalid transport options: %v", reflect.TypeOf(e.t))