mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
jsonrpc: WrapError() makes jsonrpc return unnecessary details in the error message.
This commit is contained in:
parent
4ef01bc225
commit
318265ecaf
@ -18,6 +18,9 @@ package main
|
|||||||
|
|
||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
|
// errInvalidCredentials
|
||||||
|
var errInvalidCredentials = errors.New("Invalid credentials provided")
|
||||||
|
|
||||||
// errUnAuthorizedRequest - un authorized request.
|
// errUnAuthorizedRequest - un authorized request.
|
||||||
var errUnAuthorizedRequest = errors.New("Unauthorized request")
|
var errUnAuthorizedRequest = errors.New("Unauthorized request")
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ func (web *WebAPI) PutObjectURL(r *http.Request, args *PutObjectURLArgs, reply *
|
|||||||
}
|
}
|
||||||
targetHost, err := getTargetHost(web.apiAddress, args.TargetHost)
|
targetHost, err := getTargetHost(web.apiAddress, args.TargetHost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return probe.WrapError(err)
|
return err.ToGoError()
|
||||||
}
|
}
|
||||||
client, e := minio.NewV4(targetHost, web.accessKeyID, web.secretAccessKey, web.inSecure)
|
client, e := minio.NewV4(targetHost, web.accessKeyID, web.secretAccessKey, web.inSecure)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
@ -206,7 +206,7 @@ func (web *WebAPI) GetObjectURL(r *http.Request, args *GetObjectURLArgs, reply *
|
|||||||
|
|
||||||
targetHost, err := getTargetHost(web.apiAddress, args.TargetHost)
|
targetHost, err := getTargetHost(web.apiAddress, args.TargetHost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return probe.WrapError(err)
|
return err.ToGoError()
|
||||||
}
|
}
|
||||||
client, e := minio.NewV4(targetHost, web.accessKeyID, web.secretAccessKey, web.inSecure)
|
client, e := minio.NewV4(targetHost, web.accessKeyID, web.secretAccessKey, web.inSecure)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
@ -239,11 +239,11 @@ func (web *WebAPI) Login(r *http.Request, args *LoginArgs, reply *LoginRep) erro
|
|||||||
if jwt.Authenticate(args.Username, args.Password) {
|
if jwt.Authenticate(args.Username, args.Password) {
|
||||||
token, err := jwt.GenerateToken(args.Username)
|
token, err := jwt.GenerateToken(args.Username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return probe.WrapError(err.Trace())
|
return err.ToGoError()
|
||||||
}
|
}
|
||||||
reply.Token = token
|
reply.Token = token
|
||||||
reply.UIVersion = uiVersion
|
reply.UIVersion = uiVersion
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errUnAuthorizedRequest
|
return errInvalidCredentials
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user