lux/rpc/lux_rpc_errors.go
2025-01-24 19:08:07 +02:00

36 lines
741 B
Go

package rpc
// all errors are defined here. since RPC is sync locked,
// no problem would be mutating RequestID
var LUX_RPC_ERROR_UNKNOWN_CONTROLLER = LuxRpcError{
ErrorCode: 1,
Message: "unknown controller",
}
var LUX_RPC_ERROR_ACCESS_DENIED = LuxRpcError{
ErrorCode: 2,
Message: "access denied",
}
var LUX_RPC_ERROR_UNKNOWN_COMMAND = LuxRpcError{
ErrorCode: 3,
Message: "unknown command",
}
var LUX_RPC_ERROR_GENERIC = LuxRpcError{
ErrorCode: 4,
Message: "generic error",
}
var LUX_RPC_ERROR_HOST_NOT_FOUND = LuxRpcError{
ErrorCode: 5,
Message: "host not found",
}
func LuxRpcGenericError(err error) LuxRpcError {
return LuxRpcError{
ErrorCode: LUX_RPC_ERROR_GENERIC.ErrorCode,
Message: err.Error(),
}
}