Improved code for all I/O operations wirh recover

main
LowEel 5 months ago
parent a6b296b79a
commit 878a420a31
  1. 9
      interface.go

@ -85,6 +85,15 @@ func (b *AbstractBridge) configureIpAndBridgeUp() {
func (b *AbstractBridge) removeIPandBridgeInt() {
// we want the program to recover in case of issues
defer func() {
if r := recover(); r != nil {
fmt.Println("An error happened in <removeIPandBridgeInt()>, but Zoreide recovered. ")
fmt.Println("Error was: ", r)
}
}()
br, err := tenus.NewLinkFrom(b.ExistingInterface)
if err != nil {
log.Println(err.Error())

Loading…
Cancel
Save