Better exception handling
[testsuite/pythonsdk-tests.git] / src / onaptests / scenario / basic_network.py
index de465d3..8aafd32 100644 (file)
@@ -46,18 +46,9 @@ class BasicNetwork(testcase.TestCase):
             else:
                 self.__logger.info("No cleanup requested. Test completed.")
                 self.result = 100
-        except onap_test_exceptions.ServiceInstantiateException:
-            self.__logger.error("Basic network service instantiation failed.")
-            self.result = 0
-        except onap_test_exceptions.ServiceInstantiateException:
-            self.__logger.error("Basic network service cleanup failed.")
-            self.result = 0
-        except onap_test_exceptions.NetworkInstantiateException:
-            self.__logger.error("Basic network VL instantiation failed.")
-            self.result = 0
-        except onap_test_exceptions.NetworkCleanupException:
-            self.__logger.error("Basic network VL cleanup failed.")
+        except onap_test_exceptions.OnapTestException as exc:
             self.result = 0
+            self.__logger.error(exc.error_message)
         finally:
             self.stop_time = time.time()