types

package
v0.1.149 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 1 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrServiceClient

func NewErrServiceClient(statusCode int, body []byte) error

NewErrServiceClient returns an instance of the error interface with ErrServiceClient as its implementation.

Types

type ErrNotFound

type ErrNotFound struct{}

ErrNotFound represents an error returned from a service indicating the item being asked for was not found.

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

type ErrResponseNil

type ErrResponseNil struct{}

ErrResponseNil represents an error returned from a service indicating the response was unexpectedly empty.

func (ErrResponseNil) Error

func (e ErrResponseNil) Error() string

type ErrServiceClient

type ErrServiceClient struct {
	StatusCode int // StatusCode contains the HTTP status code returned from the target service
	// contains filtered or unexported fields
}

ErrServiceClient exposes the details of a service's response in a more granular manner. This is useful when service A calls service B and service A needs to make a decision with regard to how it should respond to its own caller based on the error thrown from service B.

func (ErrServiceClient) Error

func (e ErrServiceClient) Error() string

Error fulfills the error interface and returns an error message assembled from the state of ErrServiceClient.

Jump to

Keyboard shortcuts

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