mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Enhance auth JSONRPC, now provides persistent output
Implements
- Auth.Generate("user")
- Auth.Fetch("user")
- Auth.Reset("user")
This patch also adds testing for each of these cases
This commit is contained in:
@@ -107,6 +107,9 @@ func (e *Error) Trace(fields ...string) *Error {
|
||||
|
||||
// Internal trace - records the point at which it is invoked.
|
||||
func (e *Error) trace(fields ...string) *Error {
|
||||
if e == nil {
|
||||
return nil
|
||||
}
|
||||
pc, file, line, _ := runtime.Caller(2)
|
||||
function := runtime.FuncForPC(pc).Name()
|
||||
_, function = filepath.Split(function)
|
||||
@@ -139,6 +142,9 @@ func (e *Error) Untrace() *Error {
|
||||
|
||||
// ToGoError returns original error message.
|
||||
func (e *Error) ToGoError() error {
|
||||
if e == nil || e.Cause == nil {
|
||||
return nil
|
||||
}
|
||||
return e.Cause
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user