-
Notifications
You must be signed in to change notification settings - Fork 156
Error handling
NFError has inside: message, code and error cause (it can be another error or nil).
func GetNFErrorCode(err error) ErrorCode
- returns Code from NFError or -1 if error is of different type.
func GetNFError(err error) (nferr *NFError)
- returns pointer to NFError if given agrument was of type NFError or *NFError and nil otherwise.
func (err *NFError) Cause() error
- returns error cause or err if there is no cause.
Moreover there are Error and Format methods, the first makes NFError implement error interface, the last helps print error with format specifier "%+v" which prints error with stack.
func SystemInit(args *Config) error
- common.ParseCPUListErr
- common.MaxCPUExceedErr
func SystemStart() error
- common.OpenedFlowAtTheEnd
- common.PortHasNoQueues
- common.NotAllQueuesUsed
- common.FailToInitPort
func SetWriter(IN *Flow, filename string) error
- common.UseNilFlowErr
- common.UseClosedFlowErr
func SetReceiver(par interface{}) (OUT *Flow, err error)
- common.ReqTooManyPorts
- common.BadArgument
func SetGenerator(generateFunction interface{}, targetSpeed uint64, context UserContext) (OUT *Flow, err error)
- common.BadArgument
func SetSender(IN *Flow, par interface{}) error
- common.ReqTooManyPorts
- common.BadArgument
func SetCopier(IN *Flow) (OUT *Flow, err error)
- common.UseNilFlowErr
- common.UseClosedFlowErr
func SetPartitioner(IN *Flow, N uint64, M uint64) (OUT *Flow, err error)
- common.UseNilFlowErr
- common.UseClosedFlowErr
func SetSeparator(IN *Flow, separateFunction interface{}, context UserContext) (OUT *Flow, err error)
- common.UseNilFlowErr
- common.UseClosedFlowErr
- common.BadArgument
func SetSplitter(IN *Flow, splitFunction SplitFunction, flowNumber uint, context UserContext) (OutArray [](*Flow), err error)
- common.UseNilFlowErr
- common.UseClosedFlowErr
func SetStopper(IN *Flow) error
- common.UseNilFlowErr
- common.UseClosedFlowErr
func SetHandler(IN *Flow, handleFunction interface{}, context UserContext) error
- common.UseNilFlowErr
- common.UseClosedFlowErr
- common.BadArgument
func SetMerger(InArray ...*Flow) (OUT *Flow, err error)
- common.UseNilFlowErr
- common.UseClosedFlowErr
func (scheduler *Scheduler) SystemStart() (err error)
- common.NotEnoughCores
func CreatePort(port uint8, receiveQueuesNumber uint16, sendQueuesNumber uint16, hwtxchecksum bool) error
- common.FailToInitPort
func AllocateMbufs(mb []uintptr, mempool *Mempool, n uint) error
- common.AllocMbufErr
func SetPacketStructSize(t int) error
- common.PktMbufHeadRoomTooSmall
func ParseCPUs(s string, coresNumber uint) ([]uint, error)
- common.ParseCPUListErr
- common.MaxCPUExceedErr
func GetL2ACLFromJSON(filename string) (*L2Rules, error)
- common.ParseRuleJSONErr
- common.FileError
- common.IncorrectArgInRules
- common.IncorrectRule
func GetL2ACLFromORIG(filename string) (*L2Rules, error)
- common.FileError
- common.ParseRuleError
- common.IncorrectArgInRules
- common.IncorrectRule
func GetL3ACLFromJSON(filename string)(*L3Rules, error)
- common.FileError
- common.ParseRuleJSONErr
- common.IncorrectArgInRules
- common.IncorrectRule
func GetL3ACLFromORIG(filename string) (*L3Rules, error)
- common.FileError
- common.ParseRuleError
- common.IncorrectArgInRules
- common.IncorrectRule
func WritePcapGlobalHdr(f io.Writer) error
- common.PcapWriteFail
func (pkt *Packet) WritePcapOnePacket(f io.Writer) error
- common.PcapWriteFail
func ReadPcapGlobalHdr(f io.Reader, glHdr *PcapGlobHdr) error
- common.PcapReadFail
func (pkt *Packet) ReadPcapOnePacket(f io.Reader) (bool, error)
- common.PcapReadFail