errors

package
v6.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEntityNotFound return when service return 404 HTTP status code and body is empty
	ErrEntityNotFound = &VirgilAPIError{
		Code:    10001,
		Message: "entity was not found",
	}

	// ErrInternalServerError return when service return 5xx HTTP status code and body is empty
	ErrInternalServerError = &VirgilAPIError{
		Code:    10000,
		Message: "internal server error",
	}
)

Functions

func NewSDKError

func NewSDKError(err error, params ...string) error

Types

type SDKError

type SDKError struct {
	Params   map[string]string
	InnerErr error
}

func (*SDKError) Cause

func (e *SDKError) Cause() error

func (*SDKError) Error

func (e *SDKError) Error() string

func (*SDKError) Unwrap

func (e *SDKError) Unwrap() error

type VirgilAPIError

type VirgilAPIError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

VirgilAPIError is service's errors

func (*VirgilAPIError) Error

func (err *VirgilAPIError) Error() string

func (*VirgilAPIError) Is

func (err *VirgilAPIError) Is(e error) bool

Jump to

Keyboard shortcuts

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