func (ErrInvalidToken) Recoverable() bool {
	return true
}
Recoverable whether error is recoverable or not
package protocol
import "fmt"
const (
	PrefixWrongType = "WRONGTYP"
	PrefixErr = "ERR"
)
type RecoverableError interface {
	Recoverable() bool
}
type ErrCastFailedToInt struct {
	Val interface{}
}
func (e *ErrCastFailedToInt) Error() string {
	return fmt.Sprintf("%s: error casting %v to int", PrefixErr, e.Val)
}
func (ErrCastFailedToInt) Recoverable() bool {
	return true
}
type ErrWrongType struct {
}
func (ErrWrongType) Error() string {
	return fmt.Sprintf("%s: invalid operation against key holding invalid type of value", PrefixWrongType)
}
func (ErrWrongType) Recoverable() bool {
	return true
}
type ErrGeneric struct {
	Err error
}
func (e *ErrGeneric) Error() string {
	return fmt.Sprintf("%s: %s", PrefixErr, e.Err)
}
func (ErrGeneric) Recoverable() bool {
	return true
}
type ErrWrongNumberOfArgs struct {
	Cmd string
}
func (e *ErrWrongNumberOfArgs) Error() string {
	return fmt.Sprintf("%s: %s has wrong number of arguments", PrefixWrongType, e.Cmd)
}
func (ErrWrongNumberOfArgs) Recoverable() bool {
	return true
}
type ErrUnknownCommand struct {
	Cmd string
}
func (e *ErrUnknownCommand) Error() string {
	return fmt.Sprintf("%s: unknown command %s", PrefixErr, e.Cmd)
}
func (ErrUnknownCommand) Recoverable() bool {
	return true
}
type ErrProtocolType struct {
	Type byte
}
func (e *ErrProtocolType) Recoverable() bool {
	return true
}
func (e *ErrProtocolType) Error() string {
	return fmt.Sprintf("unknown protocol type: %s", string(e.Type))
}
type ErrUnexpectString struct {
	Str string
}
func (e *ErrUnexpectString) Recoverable() bool {
	return true
}
func (e *ErrUnexpectString) Error() string {
	return fmt.Sprintf("unexpect string: %s", e.Str)
}
type ErrConvertType struct {
	Type  string
	Err   error
	Value interface{}
}
func (e *ErrConvertType) Recoverable() bool {
	return true
}
func (e *ErrConvertType) Error() string {
	if e.Err == nil {
		return fmt.Sprintf("convert %v to %s fail", e.Value, e.Type)
	}
	return fmt.Sprintf("convert %v to %s fail, because of %s", e.Value, e.Type, e.Err)
}
type ErrValueOutOfRange struct {
}
func (ErrValueOutOfRange) Error() string {
	return "value out of range"
}
func (ErrValueOutOfRange) Recoverable() bool {
	return true
}
type ErrInvalidCommand struct {
}
func (ErrInvalidCommand) Error() string {
	return "invalid command"
}
func (ErrInvalidCommand) Recoverable() bool {
	return true
}
type ErrBufferExceeded struct {
}
func (ErrBufferExceeded) Error() string {
	return "buffer exceeded"
}
func (ErrBufferExceeded) Recoverable() bool {
	return true
}
type ErrUnexpectedLineEnd struct {
}
func (ErrUnexpectedLineEnd) Error() string {
	return "unexpected line end"
}
func (ErrUnexpectedLineEnd) Recoverable() bool {
	return true
}
type ErrInvalidToken struct {
	Token byte
}
func (e *ErrInvalidToken) Error() string {
	return fmt.Sprintf("excepted $, found %c", e.Token)
}