common

package
v0.0.0-...-58fb96a Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

* Copyright (c) 2018 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is furnished to do * so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial * portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientLibraryError

type ClientLibraryError struct {
	// ErrorCode is the numerical error code.
	ErrorCode `json:"code"`
	// Retryable is a bool flag to indicate the whether the error is retryable or not.
	Retryable bool `json:"tryable"`
	// Status is the HTTP status code.
	Status int `json:"status"`
	// Msg provides a terse description of the error. Its value is defined in errorMap.
	Msg string `json:"msg"`
	// Detail provides a detailed description of the error. Its value is set using WithDetail.
	Detail string `json:"detail"`
}

ClientLibraryError is unified error

func (*ClientLibraryError) Error

func (e *ClientLibraryError) Error() string

Error implements error

func (*ClientLibraryError) WithCause

func (e *ClientLibraryError) WithCause(err error) *ClientLibraryError

WithCause adds CauseBy to error

func (*ClientLibraryError) WithDetail

func (e *ClientLibraryError) WithDetail(format string, v ...interface{}) *ClientLibraryError

WithDetail adds a detailed message to error

func (*ClientLibraryError) WithMsg

func (e *ClientLibraryError) WithMsg(format string, v ...interface{}) *ClientLibraryError

WithMsg overwrites the default error message

type ErrorCode

type ErrorCode int32

ErrorCode is unified definition of numerical error codes

const (
	// System Wide      41000 - 42000
	KinesisClientLibError ErrorCode = 41000

	// KinesisClientLibrary Retryable Errors 41001 - 41100
	KinesisClientLibRetryableError ErrorCode = 41001

	KinesisClientLibIOError         ErrorCode = 41002
	BlockedOnParentShardError       ErrorCode = 41003
	KinesisClientLibDependencyError ErrorCode = 41004
	ThrottlingError                 ErrorCode = 41005

	// KinesisClientLibrary NonRetryable Errors 41100 - 41200
	KinesisClientLibNonRetryableException ErrorCode = 41100

	InvalidStateError ErrorCode = 41101
	ShutdownError     ErrorCode = 41102

	// Kinesis Lease Errors 41200 - 41300
	LeasingError ErrorCode = 41200

	LeasingInvalidStateError          ErrorCode = 41201
	LeasingDependencyError            ErrorCode = 41202
	LeasingProvisionedThroughputError ErrorCode = 41203

	// Misc Errors 41300 - 41400
	// NotImplemented
	KinesisClientLibNotImplemented ErrorCode = 41301

	// Error indicates passing illegal or inappropriate argument
	IllegalArgumentError ErrorCode = 41302
)

pre-defined error codes

func (ErrorCode) MakeErr

func (c ErrorCode) MakeErr() *ClientLibraryError

MakeErr makes an error with default message

func (ErrorCode) MakeError

func (c ErrorCode) MakeError(detail string) error

MakeError makes an error with message and data

func (ErrorCode) Message

func (c ErrorCode) Message() string

Message returns the message of the error code

Jump to

Keyboard shortcuts

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