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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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