package errors

import (
	"github.com/pkg/errors"
)

// 定义别名
var (
	New       = errors.New
	Wrap      = errors.Wrap
	Wrapf     = errors.Wrapf
	WithStack = errors.WithStack
)

var (
	ErrBadRequest = New400Response("请求发生错误")

	ErrNoPerm                = NewResponse(401, "无访问权限", 401)
	ErrInvalidToken          = NewResponse(9999, "令牌失效", 401)
	ErrNotFound              = NewResponse(404, "资源不存在", 404)
	ErrTooManyRequests       = NewResponse(429, "请求过于频繁", 429)
	ErrInternalServer        = NewResponse(500, "服务器发生错误", 500)
	ErrDBServerInternalError = NewResponse(50001, "数据库发生错误", 500)

	// 用户错误
	ErrUnauthorized       = New400Response("未授权")
	ErrUserNotFound       = New400Response("用户不存在")
	ErrInvalidUserName    = New400Response("无效的用户名")
	ErrInvalidPassword    = New400Response("无效的密码")
	ErrInvalidUser        = New400Response("无效的用户")
	ErrInvalidParams      = New400Response("无效的请求参数")
	ErrUserDisable        = New400Response("用户被禁用")
	ErrUserNotEmptyPwd    = New400Response("密码不允许为空")
	ErrLoginInvalidOldPwd = New400Response("旧密码不正确")
	ErrUserNameExists     = New400Response("用户名已经存在")
	ErrUnknownQuery       = New400Response("未知的查询类型")
	ErrSmsCode            = New400Response("验证码不正确")
	ErrInvalidRobotType   = New400Response("无效的机器人类型")
	ErrInvalidRobotConfig = New400Response("无效的机器人配置")
)
