mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-30 18:00:56 +01:00
Revert "Revert "V0.4.0 imporve error response""
This reverts commit 9744f45e86.
This commit is contained in:
5
backend/constants/context.go
Normal file
5
backend/constants/context.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package constants
|
||||
|
||||
const (
|
||||
ContextUser = "currentUser"
|
||||
)
|
||||
13
backend/constants/errors.go
Normal file
13
backend/constants/errors.go
Normal file
@@ -0,0 +1,13 @@
|
||||
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)
|
||||
)
|
||||
Reference in New Issue
Block a user