-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.go
36 lines (30 loc) · 1.51 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2019 Meng Huang ([email protected])
// This package is licensed under a MIT license that can be found in the LICENSE file.
package raft
import (
"errors"
)
var (
// ErrNotLeader is returned when this node is not Leader.
ErrNotLeader = errors.New("this node is not Leader")
// ErrNotRunning is returned when this node do not running.
ErrNotRunning = errors.New("this node do not running")
// ErrLeaderIsNotReady is returned when the leader is not ready.
ErrLeaderIsNotReady = errors.New("Leader is not ready")
// ErrAppendEntriesFailed is returned when append entries failed.
ErrAppendEntriesFailed = errors.New("AppendEntries failed")
// ErrAppendEntriesTimeout is returned when append entries timeout.
ErrAppendEntriesTimeout = errors.New("AppendEntries timeout")
// ErrCommandNil is returned when the command is nil.
ErrCommandNil = errors.New("Command can not be nil")
// ErrCommandTimeout is returned when exec the command timeout.
ErrCommandTimeout = errors.New("command timeout")
// ErrCommandNotRegistered is returned when the command is not registered.
ErrCommandNotRegistered = errors.New("Command is not registered")
// ErrCommandTypeExisted is returned when the command type is existed.
ErrCommandTypeExisted = errors.New("CommandType is existed")
// ErrCommandType is returned when the command type = 0.
ErrCommandType = errors.New("CommandType must be > 0")
// ErrSnapshotCodecNil is returned when the snapshotCodec is nil.
ErrSnapshotCodecNil = errors.New("SnapshotCodec can not be nil")
)