from rest_framework import status
from rest_framework.response import Response
-from genericparser.pub.exceptions import GenericparserException
-from genericparser.pub.exceptions import BadRequestException
-from genericparser.pub.exceptions import NsdmBadRequestException
-from genericparser.pub.exceptions import PackageNotFoundException
-from genericparser.pub.exceptions import ResourceNotFoundException
-from genericparser.pub.exceptions import ArtifactNotFoundException
-from genericparser.pub.exceptions import NsdmDuplicateSubscriptionException
-from genericparser.pub.exceptions import VnfPkgDuplicateSubscriptionException
-from genericparser.pub.exceptions import VnfPkgSubscriptionException
+from catalog.pub.exceptions import CatalogException
+from catalog.pub.exceptions import BadRequestException
+from catalog.pub.exceptions import NsdmBadRequestException
+from catalog.pub.exceptions import PackageNotFoundException
+from catalog.pub.exceptions import ResourceNotFoundException
+from catalog.pub.exceptions import ArtifactNotFoundException
+from catalog.pub.exceptions import NsdmDuplicateSubscriptionException
+from catalog.pub.exceptions import VnfPkgDuplicateSubscriptionException
+from catalog.pub.exceptions import VnfPkgSubscriptionException
logger = logging.getLogger(__name__)
serialized_data = serializer(data=data)
if not serialized_data.is_valid():
logger.error('Data validation failed.')
- raise GenericparserException(serialized_data.errors)
+ raise CatalogException(serialized_data.errors)
return serialized_data
detail=e.args[0],
status=status.HTTP_500_INTERNAL_SERVER_ERROR
)
- except GenericparserException as e:
+ except CatalogException as e:
logger.error(e.args[0])
return make_error_resp(
detail=e.args[0],