ref
This commit is contained in:
1 parent
f3934e038e
commit
4fdf7c0ca2
19 files changed
+457
-379
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package authenticate
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"google.golang.org/grpc/codes"
|
||||
)
|
||||
|
||||
var Error errorHelper
|
||||
|
||||
func (errorHelper) Create(status codes.Code) ErrorDescription {
|
||||
return ErrorDescription{grpcStatus: status}
|
||||
}
|
||||
|
||||
type (
|
||||
errorHelper struct{}
|
||||
ErrorDescription struct {
|
||||
grpcStatus codes.Code
|
||||
}
|
||||
)
|
||||
|
||||
func (e ErrorDescription) Error() string {
|
||||
return fmt.Sprintf("%v", e)
|
||||
}
|
||||
|
||||
func (e ErrorDescription) ConvertToGrpcStatus() codes.Code {
|
||||
return e.grpcStatus
|
||||
}
|
||||
Reference in new issue
Block a user