apiutils

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Overview

Package apiutils has the types required for Error handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	ResponseCode int    //The HTTP response code from the API request
	Reason       string //The reason for throwing exception
	Response     []byte
}

APIError structure for custom error handling in API invocation

func NewAPIError

func NewAPIError(reason string, code int, res []byte) *APIError

NewAPIError implements initialization constructor Returns new APIException object

func (*APIError) Error

func (e *APIError) Error() string

Error method implements error interface

Jump to

Keyboard shortcuts

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