1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 12:45:38 +01:00
Files
glusterd2/pkg/sunrpc/errors.go
Madhu Rajanna e010dd6fdb format error strings: error strings should not
be capitalized,make first letter as lower case

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-20 16:21:29 +05:30

55 lines
1.9 KiB
Go

package sunrpc
import (
"errors"
"fmt"
)
// Internal errors
var (
ErrInvalidFragmentSize = errors.New("The RPC fragment size is invalid")
ErrRPCMessageSizeExceeded = errors.New("The RPC message size is too big")
)
// RPC errors
// ErrRPCMismatch contains the lowest and highest version of RPC protocol
// supported by the remote server
type ErrRPCMismatch struct {
Low uint32
High uint32
}
func (e ErrRPCMismatch) Error() string {
return fmt.Sprintf("RPC version not supported by server. Lowest and highest supported versions are %d and %d respectively", e.Low, e.High)
}
// ErrProgMismatch contains the lowest and highest version of program version
// supported by the remote program
type ErrProgMismatch struct {
Low uint32
High uint32
}
func (e ErrProgMismatch) Error() string {
return fmt.Sprintf("Program version not supported. Lowest and highest supported versions are %d and %d respectively", e.Low, e.High)
}
// Given that the remote server accepted the RPC call, following errors
// represent error status of an attempt to call remote procedure
var (
ErrProgUnavail = errors.New("remote server has not exported program")
ErrProcUnavail = errors.New("remote server has no such procedure")
ErrGarbageArgs = errors.New("remote procedure cannot decode params")
ErrSystemErr = errors.New("system error on remote server")
)
// These errors represent invalid replies from server and auth rejection.
var (
ErrInvalidRPCMessageType = errors.New("invalid RPC message type received")
ErrInvalidRPCRepyType = errors.New("invalid RPC reply received. Reply type should be MsgAccepted or MsgDenied")
ErrInvalidMsgDeniedType = errors.New("invalid MsgDenied reply. Possible values are RPCMismatch and AuthError")
ErrInvalidMsgAccepted = errors.New("invalid MsgAccepted reply received")
ErrAuthError = errors.New("remote server rejected identity of the caller")
)