striveexceptions

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ServerErrorCode    = -1
	ServerStatusCode   = 500
	ServerErrorMsg     = "Internal Server Error"
	ServerErrorDetails = "An unexpected error occurred"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Exception

type Exception struct {
	FullError  error
	StatusCode int         `json:"statusCode"`
	Code       int         `json:"code"`
	Message    string      `json:"message"`
	Details    interface{} `json:"details"`
}

Exception is a struct that contains the error message and the error code

func ServerError

func ServerError(err error, message *string, details *string) *Exception

func (Exception) Error

func (e Exception) Error() string

Jump to

Keyboard shortcuts

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