[docs]defcustom_exception_handler(exc,context):response=exception_handler(exc,context)ifisinstance(exc,eighth_exceptions.SignupException):response=Response({"details":exc.messages()},status=status.HTTP_400_BAD_REQUEST)elifisinstance(exc,ObjectDoesNotExist):response=Response({"details":["Object does not exist (in database)."]},status=status.HTTP_404_NOT_FOUND)ifnotresponseandnotsettings.DEBUG:logger.exception(exc)response=Response({"details":["Unknown error occurred."]},status=status.HTTP_500_INTERNAL_SERVER_ERROR)returnresponse