This commit is contained in:
DeniskaRediska committed 2019-10-24 14:37:22 +03:00
1 parent f3934e038e
commit 4fdf7c0ca2
19 files changed
+457 -379

No files matched your search

+27
View File
@@ -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
}