errors

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCError

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

CCError struct

func NewCCError

func NewCCError(errMsg string, status int32) *CCError

NewCCError creates a new CCError instance

func WrapError

func WrapError(err error, errMsg string) *CCError

WrapError stacks an error msg on top of the existing one

func WrapErrorWithStatus

func WrapErrorWithStatus(err error, errMsg string, status int32) *CCError

WrapErrorWithStatus wraps an existing error and adds a status to it

func (*CCError) Error

func (c *CCError) Error() string

Implements the error interface

func (*CCError) GetErrorResponse

func (c *CCError) GetErrorResponse() peer.Response

GetErrorResponse converts an Httperror instance to a peer.Response

func (*CCError) Message

func (c *CCError) Message() string

Message returns the inner error of a CCError instance

func (*CCError) Status

func (c *CCError) Status() int32

Status Returns the http status code

type ICCError

type ICCError interface {
	Status() int32
	Message() string
	GetErrorResponse() peer.Response
	Error() string
}

ICCError Interface implements an error interface. It contains the return http status, error message and function It also has a function to convert a response to a peer struct

Jump to

Keyboard shortcuts

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