errors

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(statusCode int, shortCode string, message string) error

NewError - Provides a constructor for the CredstackError struct

Types

type CredstackError

type CredstackError struct {
	// HTTPStatusCode - The HTTP Status Code that correlates to this error
	HTTPStatusCode int

	// ShortCode - A string representing a shorter error message that can be used to validate the type of error
	ShortCode string

	// Message - A string representing the error message
	Message string
}

CredstackError - Provides a custom error structure that provides more information regarding errors than the standard error struct. This implemented the error interface so it can be use interchangeably with standard Go code

func (CredstackError) Error

func (err CredstackError) Error() string

Error - Returns the error message that is stored in the CredstackError struct. Required to implement the error interface

func (CredstackError) HTTPCode

func (err CredstackError) HTTPCode() int

HTTPCode - Returns the HTTP Status Code that correlates to this error

func (CredstackError) Short

func (err CredstackError) Short() string

Short - Provides the short code of the error in the form of a string

Jump to

Keyboard shortcuts

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