Improved code for all I/O operations wirh recover
parent
a6b296b79a
commit
878a420a31
|
@ -85,6 +85,15 @@ func (b *AbstractBridge) configureIpAndBridgeUp() {
|
||||||
|
|
||||||
func (b *AbstractBridge) removeIPandBridgeInt() {
|
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)
|
br, err := tenus.NewLinkFrom(b.ExistingInterface)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err.Error())
|
log.Println(err.Error())
|
||||||
|
|
Loading…
Reference in New Issue