func New(group Group, code int32, msg string, details []interface{}) *Status {
	return &Status{Group: group, Code: code, Message: msg, Details: details}
}
New returns a Status with the given parameters
package status
import (
	"fmt"
	"github.com/pkg/errors"
	"github.com/hyperledger/fabric-sdk-go/pkg/errors/multi"
	pb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/peer"
	grpcstatus "google.golang.org/grpc/status"
)
type Status struct {
	Group Group
	Code int32
	Message string
	Details []interface{}
}
type Group int32
const (
	UnknownStatus Group = iota
	GRPCTransportStatus
	HTTPTransportStatus
	EndorserServerStatus
	EventServerStatus
	OrdererServerStatus
	FabricCAServerStatus
	EndorserClientStatus
	OrdererClientStatus
	ClientStatus
)
var GroupName = map[int32]string{
	0: "Unknown",
	1: "gRPC Transport Status",
	2: "HTTP Transport Status",
	3: "Endorser Server Status",
	4: "Event Server Status",
	5: "Orderer Server Status",
	6: "Fabric CA Server Status",
	7: "Endorser Client Status",
	8: "Orderer Client Status",
	9: "Client Status",
}
func (g Group) String() string {
	if s, ok := GroupName[int32(g)]; ok {
		return s
	}
	return UnknownStatus.String()
}
func FromError(err error) (s *Status, ok bool) {
	if err == nil {
		return &Status{Code: int32(OK)}, true
	}
	if s, ok := err.(*Status); ok {
		return s, true
	}
	unwrappedErr := errors.Cause(err)
	if s, ok := unwrappedErr.(*Status); ok {
		return s, true
	}
	if m, ok := unwrappedErr.(multi.Errors); ok {
		return New(ClientStatus, MultipleErrors.ToInt32(), m.Error(), nil), true
	}
	return nil, false
}
func (s *Status) Error() string {
	return fmt.Sprintf("%s Code: (%d) %s. Description: %s", s.Group.String(), s.Code, s.codeString(), s.Message)
}
func (s *Status) codeString() string {
	switch s.Group {
	case GRPCTransportStatus:
		return ToGRPCStatusCode(s.Code).String()
	case EndorserServerStatus, OrdererServerStatus:
		return ToFabricCommonStatusCode(s.Code).String()
	case EventServerStatus:
		return ToTransactionValidationCode(s.Code).String()
	case EndorserClientStatus, OrdererClientStatus, ClientStatus:
		return ToSDKStatusCode(s.Code).String()
	default:
		return Unknown.String()
	}
}