Documentation ¶
Index ¶
- Variables
- func As(err error, target any) bool
- func Is(err, target error) bool
- func New(text string) error
- func NewError(status int, code any, message, typ string) error
- func NewErrorf(status int, code any, message, typ string, args ...interface{}) error
- func Newf(format string, args ...interface{}) error
- type FastApiError
- type IFastApiError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ERR_NIL = NewError(500, -1, "", "fastapi_error") ERR_UNKNOWN = NewError(500, -1, "Unknown Error", "fastapi_error") ERR_SYSTEM = NewError(500, -1, "System Error.", "fastapi_error") ERR_INTERNAL_ERROR = NewError(500, 500, "Internal Error", "fastapi_error") ERR_INVALID_PARAMETER = NewError(400, "fastapi_error", "Invalid Parameter.", "fastapi_error") ERR_NOT_FOUND = NewError(404, "unknown_url", "Unknown request URL", "invalid_request_error") ERR_NO_AVAILABLE_KEY = NewError(500, "fastapi_error", "No available key", "fastapi_error") ERR_NO_AVAILABLE_MODEL_AGENT = NewError(500, "fastapi_error", "No available model agent", "fastapi_error") ERR_NO_AVAILABLE_MODEL_AGENT_KEY = NewError(500, "fastapi_error", "No available model agent key", "fastapi_error") ERR_NOT_AUTHORIZED = NewError(403, "fastapi_error", "Not Authorized", "fastapi_error") ERR_NOT_API_KEY = NewError(401, "invalid_request_error", "You didn't provide an API key.", "invalid_request_error") ERR_INVALID_API_KEY = NewError(401, "invalid_api_key", "Incorrect API key provided or has been disabled.", "fastapi_request_error") ERR_API_KEY_DISABLED = NewError(401, "api_key_disabled", "Key has been disabled.", "fastapi_request_error") ERR_INVALID_USER = NewError(401, "invalid_user", "User does not exist or has been disabled.", "fastapi_request_error") ERR_USER_DISABLED = NewError(401, "user_disabled", "User has been disabled.", "fastapi_request_error") ERR_INVALID_APP = NewError(401, "invalid_app", "App does not exist or has been disabled.", "fastapi_request_error") ERR_APP_DISABLED = NewError(401, "app_disabled", "App has been disabled.", "fastapi_error") ERR_MODEL_NOT_FOUND = NewError(404, "model_not_found", "The model does not exist or you do not have access to it.", "fastapi_request_error") ERR_PATH_NOT_FOUND = NewError(404, "path_not_found", "The path does not exist or you do not have access to it.", "fastapi_request_error") ERR_MODEL_DISABLED = NewError(401, "model_disabled", "Model has been disabled.", "fastapi_request_error") ERR_INSUFFICIENT_QUOTA = NewError(429, "insufficient_quota", "You exceeded your current quota.", "insufficient_quota") )
Functions ¶
Types ¶
type FastApiError ¶ added in v0.2.0
func (*FastApiError) ErrCode ¶ added in v0.2.0
func (e *FastApiError) ErrCode() any
func (*FastApiError) ErrMessage ¶ added in v0.2.0
func (e *FastApiError) ErrMessage() string
func (*FastApiError) ErrType ¶ added in v0.2.0
func (e *FastApiError) ErrType() string
func (*FastApiError) Error ¶ added in v0.2.0
func (e *FastApiError) Error() string
func (*FastApiError) Status ¶ added in v0.2.0
func (e *FastApiError) Status() int
func (*FastApiError) Unwrap ¶ added in v0.2.0
func (e *FastApiError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.