2024-06-24 16:55:36 +00:00
|
|
|
package daemon
|
|
|
|
|
|
|
|
import "isle/daemon/jsonrpc2"
|
|
|
|
|
|
|
|
var (
|
2024-07-07 10:44:49 +00:00
|
|
|
// ErrNoNetwork is returned when the daemon has never been configured with a
|
|
|
|
// network.
|
|
|
|
ErrNoNetwork = jsonrpc2.NewError(1, "No network configured")
|
|
|
|
|
2024-07-06 13:36:48 +00:00
|
|
|
// ErrInitializing is returned when a network is unavailable due to still
|
2024-06-24 16:55:36 +00:00
|
|
|
// being initialized.
|
2024-07-07 10:44:49 +00:00
|
|
|
ErrInitializing = jsonrpc2.NewError(2, "Network is being initialized")
|
2024-06-24 16:55:36 +00:00
|
|
|
|
2024-07-07 10:44:49 +00:00
|
|
|
// ErrAlreadyJoined is returned when the daemon is instructed to create or
|
|
|
|
// join a new network, but it is already joined to a network.
|
|
|
|
ErrAlreadyJoined = jsonrpc2.NewError(4, "Already joined to a network")
|
2024-07-07 18:01:10 +00:00
|
|
|
|
|
|
|
// ErrInvalidConfig is returned when the daemon's configuration is invalid
|
|
|
|
// for an operation being attempted.
|
|
|
|
//
|
|
|
|
// The Data field will be a string containing further details.
|
|
|
|
ErrInvalidConfig = jsonrpc2.NewError(5, "Invalid daemon config")
|
2024-07-13 14:08:13 +00:00
|
|
|
|
|
|
|
// ErrHostNotFound is returned when performing an operation which expected a
|
|
|
|
// host to exist in the network, but that host wasn't found.
|
|
|
|
ErrHostNotFound = jsonrpc2.NewError(6, "Host not found")
|
2024-06-24 16:55:36 +00:00
|
|
|
)
|