exception

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIException

type APIException interface {
	error
	ErrorCode() int
	ErrorText() string
	Data() interface{}
}

APIException API异常

func BadGateway

func BadGateway(formatOrmess string, vars ...interface{}) APIException

BadGateway 作为网关或者代理工作的服务器尝试执行请求时,从远程服务器接收到了一个无效的响应

func BadRequest

func BadRequest(formatOrmess string, vars ...interface{}) APIException

func Conflict

func Conflict(formatOrmess string, vars ...interface{}) APIException

func Forbidden

func Forbidden(formatOrmess string, vars ...interface{}) APIException

func GatewayTimeout

func GatewayTimeout(formatOrmess string, vars ...interface{}) APIException

GatewayTimeout 作为网关或者代理工作的服务器尝试执行请求时,未能及时从上游服务器(URI标识出的服务器,例如HTTP、FTP、LDAP)或者辅助服务器(例如DNS)收到响应。

func InternalServerError

func InternalServerError(formatOrmess string, vars ...interface{}) APIException

InternalServerError 服务器遇到了一个未曾预料的状况,导致了它无法完成对请求的处理。一般来说,这个问题都会在服务器端的源代码出现错误时出现。

func MethodNotAllowed

func MethodNotAllowed(formatOrmess string, vars ...interface{}) APIException

func NewAPIException

func NewAPIException(code int, reason, formatOrMess string, vars ...interface{}) APIException

NewAPIException 除了本包默认的 exception,还可以根据此函数扩展 API异常种类

func NotFound

func NotFound(formatOrmess string, vars ...interface{}) APIException

func NotFoundError

func NotFoundError(formatOrmess string, vars ...interface{}) APIException

func OnlyOneError

func OnlyOneError(formatOrmess string, vars ...interface{}) APIException

func RequestTimeOut

func RequestTimeOut(formatOrmess string, vars ...interface{}) APIException

func SQLExecuteError

func SQLExecuteError(formatOrmess string, vars ...interface{}) APIException

func SQLPrepareError

func SQLPrepareError(formatOrmess string, vars ...interface{}) APIException

func SQLStartStmtError

func SQLStartStmtError(formatOrmess string, vars ...interface{}) APIException

func ServiceUnavailable

func ServiceUnavailable(formatOrmess string, vars ...interface{}) APIException

ServiceUnavailable 由于超载或系统维护,服务器暂时的无法处理客户端的请求。延时的长度可包含在服务器的Retry-After头信息中

func Unauthorized

func Unauthorized(formatOrmess string, vars ...interface{}) APIException

Jump to

Keyboard shortcuts

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