isle/go/daemon/network/errors.go

39 lines
1.3 KiB
Go
Raw Permalink Normal View History

package network
import (
"isle/daemon/daecommon"
"isle/daemon/jsonrpc2"
)
const (
errCodeInitializing = daecommon.ErrorCodeRangeNetwork + iota
errCodeInvalidConfig
errCodeHostNotFound
2024-12-12 19:20:27 +00:00
errCodeIPInUse
errCodeSecretNotFound
)
var (
// ErrInitializing is returned when a network is unavailable due to still
// being initialized.
ErrInitializing = jsonrpc2.NewError(errCodeInitializing, "Network is being initialized")
// 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(errCodeInvalidConfig, "Invalid daemon config")
// 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(errCodeHostNotFound, "Host not found")
2024-12-12 19:20:27 +00:00
// ErrIPInUse is returned when performing an operation which was provided an
// IP already in use by another host in the network.
ErrIPInUse = jsonrpc2.NewError(errCodeIPInUse, "IP in use")
// ErrSecretNotFound is returned when a secret was required to perform some
// action, but the secret is not found in the secret store.
ErrSecretNotFound = jsonrpc2.NewError(errCodeSecretNotFound, "Secret not found")
)