exception

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalExceptionInterceptor

func GlobalExceptionInterceptor(context *gin.Context)

GlobalExceptionInterceptor gin global exception interceptor add via gin middleware. an error of -10400 is thrown when the exception type is string and the BusinessException

func OrThrow

func OrThrow(err error)

OrThrow If err not nil, a system-level exception is thrown.

func OrThrowBusiness added in v2.2.1

func OrThrowBusiness(err error)

OrThrowBusiness If err not nil, a business-level exception is thrown.

Types

type BusinessException

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

BusinessException the service level exception, the service code is -10400, equivalent to resp.BadRequest

Jump to

Keyboard shortcuts

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