old_contents: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  __author__ = 'Alberto Paro'
  
  __all__ = ['NoServerAvailable',
             "QueryError",
             "NotFoundException", 
             "AlreadyExistsException", 
             "IndexMissingException",
             "SearchPhaseExecutionException",
             "InvalidQuery",
             "InvalidParameterQuery",
             "QueryParameterError",
             "ReplicationShardOperationFailedException",
             "ClusterBlockException"]
  
  class NoServerAvailable(Exception):
      pass
  
  class InvalidQuery(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
  
  class InvalidParameterQuery(InvalidQuery):
      pass
  
  class QueryError(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
      
  class IndexMissingException(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
  
  class QueryParameterError(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
  
      message = property(_get_message, _set_message)
  
  class NotFoundException(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
  
  class AlreadyExistsException(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
      
  class SearchPhaseExecutionException(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
  
  class ReplicationShardOperationFailedException(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
  
  class ClusterBlockException(Exception):
      def _get_message(self): 
          return self._message
      def _set_message(self, message): 
          self._message = message
      message = property(_get_message, _set_message)
  
new_contents: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  __author__ = 'Alberto Paro'
  
  __all__ = ['NoServerAvailable',
             "QueryError",
             "NotFoundException",
             "AlreadyExistsException",
             "IndexMissingException",
             "SearchPhaseExecutionException",
             "InvalidQuery",
             "InvalidParameterQuery",
             "QueryParameterError",
             "ReplicationShardOperationFailedException",
             "ClusterBlockException",
             "ElasticSearchException",
            ]
  
  class NoServerAvailable(Exception):
      pass
  
  
  class InvalidQuery(Exception):
      pass
  
  class InvalidParameterQuery(InvalidQuery):
      pass
  
  class QueryError(Exception):
      pass
  
  class QueryParameterError(Exception):
      pass
  
  
  class ElasticSearchException(Exception):
      """Base class of exceptions raised as a result of parsing an error return
      from ElasticSearch.
  
      An exception of this class will be raised if no more specific subclass is
      appropriate.
  
      """
      def __init__(self, error, status=None):
          super(ElasticSearchException, self).__init__(error)
          self.status = status
  
  class IndexMissingException(ElasticSearchException):
      pass
  
  class NotFoundException(ElasticSearchException):
      pass
  
  class AlreadyExistsException(ElasticSearchException):
      pass
  
  class SearchPhaseExecutionException(ElasticSearchException):
      pass
  
  class ReplicationShardOperationFailedException(ElasticSearchException):
      pass
  
  class ClusterBlockException(ElasticSearchException):
      pass
  
subject: Add ElasticSearchException, as a base class of all exceptions raised by parsing an error response from ElasticSearch, and as an exception class to contain error responses which can be parsed, but for which there is no corresponding python type currently. Also, remove the unused message properties from the exception classes - these are never set, and never tested.