Skip to content

Commit

Permalink
Move internal error message into settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
erichuanggit committed Sep 10, 2015
1 parent cfb6b82 commit a70147b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pdc/apps/common/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ def exception_handler(exc, context):
else:
logger = logging.getLogger(__name__)
logger.error('Unhandled exception', exc_info=sys.exc_info())
return Response({'detail': 'The server encountered an internal '
'error or misconfiguration and was '
'unable to complete your request.'},
return Response(data=settings.INTERNAL_SERVER_ERROR_RESPONSE,
status=status.HTTP_503_SERVICE_UNAVAILABLE)
return response
4 changes: 4 additions & 0 deletions pdc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@
'correct URL but not forward the request body.'])
}

INTERNAL_SERVER_ERROR_RESPONSE = {
'detail': 'The server encountered an internal error or misconfiguration and was unable to complete your request.'
}

# Messaging Bus Config
MESSAGE_BUS = {
# MLP: Messaging Library Package
Expand Down

0 comments on commit a70147b

Please sign in to comment.