# -*- coding: utf-8 -*-
# vim:fenc=utf-8

"""
haproxyadmin.exceptions
~~~~~~~~~~~~~~~~~~~~~~~

This module contains the set of haproxyadmin' exceptions.

"""


class CommandFailed(Exception):
    """Raised when a command to HAProxy returned an error.

    Arguments:
        message (str): String returned by HAProxy
    """
    def __init__(self, message):
        super(CommandFailed, self).__init__(message)

class MultipleCommandResults(Exception):
    """Command returned different results per HAProxy process."""
    def __init__(self, results):
        self.message = 'Received different result per HAProxy process'
        self.results = results
        super(MultipleCommandResults, self).__init__(self.message)

class IncosistentData(Exception):
    """Data across all processes is not the same."""
    def __init__(self, results):
        self.message = 'Received different data per HAProxy process'
        self.results = results
        super(IncosistentData, self).__init__(self.message)

@@ -253,68 +253,68 @@
     
-Arguments:%0A        message (str): String returned by HAProxy
+:param message: error message.%0A    :type message: %60%60string%60%60
 %0A   
@@ -927,32 +927,32 @@
 sults = results%0A
-
         super(In
@@ -975,28 +975,1217 @@
 elf).__init__(self.message)%0A
+%0Aclass SocketPermissionError(Exception):%0A    %22%22%22Raised when permissions are not granted to access socket file.%0A%0A    :param socket_file: socket file.%0A    :type socket_file: %60%60string%60%60%0A    %22%22%22%0A    def __init__(self, socket_file):%0A        self.message = 'No permissions are granted to access socket file'%0A        self.socket_file = socket_file%0A        super(SocketPermissionError, self).__init__(self.message)%0A%0Aclass SocketConnectionError(Exception):%0A    %22%22%22Raised when socket file is not bound to a process.%0A%0A    :param socket_file: socket file.%0A    :type socket_file: %60%60string%60%60%0A    %22%22%22%0A    def __init__(self, socket_file):%0A        self.message = 'No process is bound to socket file'%0A        self.socket_file = socket_file%0A        super(SocketConnectionError, self).__init__(self.message)%0A%0Aclass SocketApplicationError(Exception):%0A    %22%22%22Raised when we connect to a socket but not HAProxy is bound to it.%0A%0A    :param socket_file: socket file.%0A    :type socket_file: %60%60string%60%60%0A    %22%22%22%0A    def __init__(self, socket_file):%0A        self.message = 'HAProxy is not bound to socket file'%0A        self.socket_file = socket_file%0A        super(SocketApplicationError, self).__init__(self.message)%0A%0A

add a bunch of exceptions for catching errors when we test socket file