Files
crawlab/backend/constants/errors.go
yaziming 71c83251e5 feat(backend): add some feat for error message system
errors support custom http code and support return invalid validated
error
2019-09-03 15:23:08 +08:00

14 lines
416 B
Go

package constants
import (
"crawlab/errors"
"net/http"
)
var (
ErrorMongoError = errors.NewSystemOPError(1001, "system error:[mongo]%s", http.StatusInternalServerError)
//users
ErrorUserNotFound = errors.NewBusinessError(10001, "user not found.", http.StatusUnauthorized)
ErrorUsernameOrPasswordInvalid = errors.NewBusinessError(11001, "username or password invalid", http.StatusUnauthorized)
)