Merge "merge of Natalia - change rnib errors"
[ric-plt/e2mgr.git] / E2Manager / handlers / e2_term_init_notification_handler.go
index 7299910..6cc88ae 100644 (file)
@@ -41,8 +41,9 @@ func NewE2TermInitNotificationHandler(ranReconnectionManager *managers.RanReconn
 func (handler E2TermInitNotificationHandler) Handle(logger *logger.Logger, e2Sessions sessions.E2Sessions,
        request *models.NotificationRequest, messageChannel chan<- *models.NotificationResponse) {
 
-       nbIdentityList, err := handler.rnibReaderProvider().GetListNodebIds()
+       logger.Infof("#E2TermInitNotificationHandler.Handle - Handling E2_TERM_INIT")
 
+       nbIdentityList, err := handler.rnibReaderProvider().GetListNodebIds()
        if err != nil {
                logger.Errorf("#E2TermInitNotificationHandler.Handle - Failed to get nodes list from RNIB. Error: %s", err.Error())
                return
@@ -57,11 +58,12 @@ func (handler E2TermInitNotificationHandler) Handle(logger *logger.Logger, e2Ses
 
                if err := handler.ranReconnectionManager.ReconnectRan(nbIdentity.InventoryName); err != nil {
                        logger.Errorf("#E2TermInitNotificationHandler.Handle - Ran name: %s - connection attempt failure, error: %s", (*nbIdentity).GetInventoryName(), err.Error())
-                       rNibError, ok := err.(common.IRNibError)
-                       if !ok || rNibError.GetCode() != common.RESOURCE_NOT_FOUND {
+                       _, ok := err.(*common.ResourceNotFoundError)
+                       if !ok {
                                break
                        }
                }
        }
+
        logger.Infof("#E2TermInitNotificationHandler.Handle - Completed handling of E2_TERM_INIT")
 }