errs

package
v2.0.0-...-ca652af Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrAPIRequestRejected        = harvestError("API request rejected")
	ErrAPIResponse               = harvestError("error reading api response")
	ErrAttributeNotFound         = harvestError("attribute not found")
	ErrAuthFailed                = harvestError("auth failed")
	ErrConfig                    = harvestError("configuration error")
	ErrConnection                = harvestError("connection error")
	ErrImplement                 = harvestError("implementation error")
	ErrInvalidItem               = harvestError("invalid item")
	ErrInvalidParam              = harvestError("invalid parameter")
	ErrMissingParam              = harvestError("missing parameter")
	ErrNoCollector               = harvestError("no collectors")
	ErrNoInstance                = harvestError("no instances")
	ErrNoMetric                  = harvestError("no metrics")
	ErrPermissionDenied          = harvestError("Permission denied")
	ErrResponseNotFound          = harvestError("response not found")
	ErrWrongTemplate             = harvestError("wrong template")
	ErrMetroClusterNotConfigured = harvestError("MetroCluster is not configured in cluster")
)
View Source
const (
	ErrNumZAPISuspended  = "61253"
	ZAPIPermissionDenied = "13003"
)

Variables

View Source
var (
	APINotFound               = OntapRestCode{"API not found", 3}
	TableNotFound             = OntapRestCode{"Table is not found", 8585320}
	MetroClusterNotConfigured = OntapRestCode{"MetroCluster is not configured in cluster", 2426405}
	CMReject                  = OntapRestCode{"CM reject", 8585368}
)

Functions

func IsRestErr

func IsRestErr(err error, sentinel OntapRestCode) bool

func New

func New(innerError error, message string, opts ...Option) error

func NewStorageGridErr

func NewStorageGridErr(statusCode int, jsonText []byte) error

Types

type HarvestError

type HarvestError struct {
	Message    string
	Inner      error
	ErrNum     string
	StatusCode int
}

func (HarvestError) Error

func (e HarvestError) Error() string

func (HarvestError) Unwrap

func (e HarvestError) Unwrap() error

type Message

type Message struct {
	Text string `json:"text"`
	Key  string `json:"key"`
}

type OntapRestCode

type OntapRestCode struct {
	Name string
	Code int64
}

type Option

type Option func(*HarvestError)

func WithErrorNum

func WithErrorNum(errNum string) Option

func WithStatus

func WithStatus(statusCode int) Option

type RestError

type RestError struct {
	Err        error
	Message    string
	Target     string
	Code       int64
	StatusCode int
	API        string
}

func (*RestError) Error

func (r *RestError) Error() string

func (*RestError) Unwrap

func (r *RestError) Unwrap() error

type RestErrorBuilder

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

func NewRest

func NewRest() *RestErrorBuilder

func (*RestErrorBuilder) API

func (*RestErrorBuilder) Build

func (b *RestErrorBuilder) Build() error

func (*RestErrorBuilder) Code

func (b *RestErrorBuilder) Code(code int64) *RestErrorBuilder

func (*RestErrorBuilder) Error

func (b *RestErrorBuilder) Error(err error) *RestErrorBuilder

func (*RestErrorBuilder) Message

func (b *RestErrorBuilder) Message(message string) *RestErrorBuilder

func (*RestErrorBuilder) StatusCode

func (b *RestErrorBuilder) StatusCode(statusCode int) *RestErrorBuilder

func (*RestErrorBuilder) Target

func (b *RestErrorBuilder) Target(target string) *RestErrorBuilder

type StorageGridError

type StorageGridError struct {
	Message Message `json:"message"`
	Code    int     `json:"code"`
	Status  string  `json:"status"`
}

func (StorageGridError) Error

func (s StorageGridError) Error() string

func (StorageGridError) IsAuthErr

func (s StorageGridError) IsAuthErr() bool

Jump to

Keyboard shortcuts

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