isle/go/daemon/errors.go

45 lines
1.3 KiB
Go
Raw Normal View History

package daemon
import (
"isle/daemon/daecommon"
"isle/daemon/jsonrpc2"
)
const (
errCodeNoNetwork = daecommon.ErrorCodeRangeDaemon + iota
errCodeAlreadyJoined
errCodeNoMatchingNetworks
errCodeMultipleMatchingNetworks
2024-11-18 21:25:49 +00:00
errCodeManagedNetworkConfig
)
var (
// ErrNoNetwork is returned when the daemon has never been configured with a
// network.
ErrNoNetwork = jsonrpc2.NewError(errCodeNoNetwork, "No network configured")
// ErrAlreadyJoined is returned when the daemon is instructed to create or
// join a new network, but it is already joined to that network.
ErrAlreadyJoined = jsonrpc2.NewError(errCodeAlreadyJoined, "Already joined to a network")
// ErrNoMatchingNetworks is returned if the search string didn't match any
// networks.
ErrNoMatchingNetworks = jsonrpc2.NewError(
errCodeNoMatchingNetworks, "No networks matched the search string",
)
// ErrMultipleMatchingNetworks is returned if the search string matched
// multiple networks.
ErrMultipleMatchingNetworks = jsonrpc2.NewError(
errCodeMultipleMatchingNetworks,
"Multiple networks matched the search string",
)
2024-11-18 21:25:49 +00:00
// ErrManagedNetworkConfig is returned when attempting to modify a
// network config which is managed by the user.
2024-11-18 21:25:49 +00:00
ErrManagedNetworkConfig = jsonrpc2.NewError(
errCodeManagedNetworkConfig,
"Network configuration is managed by the daemon.yml",
)
)