Refactor codes for vnf pkg artifact
[vfc/nfvo/catalog.git] / catalog / packages / views / common.py
index f7e3f70..e902f57 100644 (file)
@@ -22,6 +22,7 @@ from catalog.pub.exceptions import CatalogException
 from catalog.pub.exceptions import NsdmBadRequestException
 from catalog.pub.exceptions import PackageNotFoundException
 from catalog.pub.exceptions import ResourceNotFoundException
+from catalog.pub.exceptions import ArtifactNotFoundException
 
 logger = logging.getLogger(__name__)
 
@@ -65,6 +66,12 @@ def view_safe_call_with_log(logger):
                     detail=e.message,
                     status=status.HTTP_404_NOT_FOUND
                 )
+            except ArtifactNotFoundException as e:
+                logger.error(e.message)
+                return make_error_resp(
+                    detail=e.message,
+                    status=status.HTTP_404_NOT_FOUND
+                )
             except NsdmBadRequestException as e:
                 logger.error(e.message)
                 return make_error_resp(