summaryrefslogtreecommitdiffstats
path: root/django/engagementmanager/utils/exception_message_factory.py
diff options
context:
space:
mode:
authorEdan Binshtok <eb578m@intl.att.com>2017-11-19 11:42:55 +0200
committerEdan Binshtok <eb578m@intl.att.com>2017-11-19 11:43:15 +0200
commita9ef6f094a2bcf1fd7a0b7c2aaf814841db558ec (patch)
tree81a3f8436f9e6af07c3070c74f3a0543c2ca5eff /django/engagementmanager/utils/exception_message_factory.py
parentc169d08d437ccb62fd79ade759077b874f00b1c3 (diff)
Pep8 more fixes
Update base files to pass pep8 strict standarts. Issue-ID: VVP-25 Change-Id: If9ef80abf7fbc33ea181dfc2eb73c27ddd6ddc3e Signed-off-by: Edan Binshtok <eb578m@intl.att.com>
Diffstat (limited to 'django/engagementmanager/utils/exception_message_factory.py')
-rw-r--r--django/engagementmanager/utils/exception_message_factory.py98
1 files changed, 66 insertions, 32 deletions
diff --git a/django/engagementmanager/utils/exception_message_factory.py b/django/engagementmanager/utils/exception_message_factory.py
index 6ea96f4..7904e02 100644
--- a/django/engagementmanager/utils/exception_message_factory.py
+++ b/django/engagementmanager/utils/exception_message_factory.py
@@ -1,5 +1,5 @@
-#
-# ============LICENSE_START==========================================
+#
+# ============LICENSE_START==========================================
# org.onap.vvp/engagementmgr
# ===================================================================
# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
@@ -49,36 +49,70 @@ from rest_framework.exceptions import MethodNotAllowed, NotAuthenticated, \
class ExceptionMessageFactory:
messages_dictionary = {
- ObjectDoesNotExist.__name__: {'msg': 'User or Password does not match', 'include_exception': False,
- 'status': status.HTTP_404_NOT_FOUND},
- MethodNotAllowed.__name__: {'msg': 'Method not allowed: ', 'include_exception': True,
- 'status': status.HTTP_405_METHOD_NOT_ALLOWED},
- NotAuthenticated.__name__: {'msg': 'You must authenticate in order to perform this action: ',
- 'include_exception': True, 'status': status.HTTP_403_FORBIDDEN},
- SignatureExpired.__name__: {'msg': 'Signature expired for this token: ', 'include_exception': True,
- 'status': status.HTTP_405_METHOD_NOT_ALLOWED},
- KeyError.__name__: {'msg': 'KeyError occurred over the backend.', 'include_exception': True,
- 'include_additional_exc_str': True, 'status': status.HTTP_400_BAD_REQUEST},
- ValueError.__name__: {'msg': 'ValueError occurred over the backend: ', 'include_exception': True,
- 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
- ConnectionError.__name__: {'msg': 'ConnectionError occurred over the backend: ', 'include_exception': True,
- 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
- ImportError.__name__: {'msg': 'ImportError occurred over the backend: ', 'include_exception': True,
- 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
- CommandError.__name__: {'msg': 'CommandError occurred over the backend: ', 'include_exception': True,
- 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
- PermissionDenied.__name__: {'msg': 'PermissionDenied occurred over the backend: ', 'include_exception': True,
- 'status': status.HTTP_401_UNAUTHORIZED},
- VvpObjectNotAvailable.__name__: {'msg': '', 'include_exception': True, 'status': status.HTTP_410_GONE},
- NotAcceptable.__name__: {'msg': '', 'include_exception': True, 'status': status.HTTP_403_FORBIDDEN},
- VvpGeneralException.__name__: {'msg': '', 'include_exception': True,
- 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
- FileExistsError.__name__: {'msg': 'Not modified due to: ', 'include_exception': True,
- 'status': status.HTTP_304_NOT_MODIFIED},
- VvpBadRequest.__name__: {'msg': '', 'include_exception': True, 'status': status.HTTP_400_BAD_REQUEST},
- VvpConflict.__name__: {'msg': '', 'include_exception': True, 'status': status.HTTP_409_CONFLICT},
- Exception.__name__: {'msg': 'General error on backend: ', 'include_exception': True,
- 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
+ ObjectDoesNotExist.__name__: {
+ 'msg': 'User or Password does not match',
+ 'include_exception': False,
+ 'status': status.HTTP_404_NOT_FOUND},
+ MethodNotAllowed.__name__: {
+ 'msg': 'Method not allowed: ',
+ 'include_exception': True,
+ 'status':
+ status.HTTP_405_METHOD_NOT_ALLOWED},
+ NotAuthenticated.__name__: {
+ 'msg': 'You must authenticate in order to perform this action: ',
+ 'include_exception': True, 'status': status.HTTP_403_FORBIDDEN},
+ SignatureExpired.__name__: {
+ 'msg': 'Signature expired for this token: ',
+ 'include_exception': True,
+ 'status':
+ status.HTTP_405_METHOD_NOT_ALLOWED},
+ KeyError.__name__: {
+ 'msg': 'KeyError occurred over the backend.',
+ 'include_exception': True,
+ 'include_additional_exc_str': True, 'status':
+ status.HTTP_400_BAD_REQUEST},
+ ValueError.__name__: {
+ 'msg': 'ValueError occurred over the backend: ',
+ 'include_exception': True,
+ 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
+ ConnectionError.__name__: {
+ 'msg': 'ConnectionError occurred over the backend: ',
+ 'include_exception': True,
+ 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
+ ImportError.__name__: {
+ 'msg': 'ImportError occurred over the backend: ',
+ 'include_exception': True,
+ 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
+ CommandError.__name__: {
+ 'msg': 'CommandError occurred over the backend: ',
+ 'include_exception': True,
+ 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
+ PermissionDenied.__name__: {
+ 'msg': 'PermissionDenied occurred over the backend: ',
+ 'include_exception': True,
+ 'status': status.HTTP_401_UNAUTHORIZED},
+ VvpObjectNotAvailable.__name__: {
+ 'msg': '', 'include_exception': True,
+ 'status': status.HTTP_410_GONE},
+ NotAcceptable.__name__: {
+ 'msg': '', 'include_exception': True,
+ 'status': status.HTTP_403_FORBIDDEN},
+ VvpGeneralException.__name__: {
+ 'msg': '', 'include_exception': True,
+ 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
+ FileExistsError.__name__: {
+ 'msg': 'Not modified due to: ', 'include_exception': True,
+ 'status': status.HTTP_304_NOT_MODIFIED},
+ VvpBadRequest.__name__: {
+ 'msg': '', 'include_exception': True,
+ 'status': status.HTTP_400_BAD_REQUEST},
+ VvpConflict.__name__: {
+ 'msg': '', 'include_exception': True,
+ 'status': status.HTTP_409_CONFLICT},
+ Exception.__name__: {
+ 'msg': 'General error on backend: ',
+ 'include_exception': True,
+ 'status': status.HTTP_500_INTERNAL_SERVER_ERROR},
}
def get_exception_message(self, exception):