#╔════════╦═══════════════════════╦════════╗
#║        ║       Stegencry       ║        ║
#║   ___  ╚═══════════════════════╝  ___   ║
#║  (o o)                           (o o)  ║
#║ (  V  )  Julien Calenge © 2021  (  V  ) ║
#╠═══m═m═════════════════════════════m═m═══╣
#╠════ File name: exception_management.py  ║
#╠═══ Description: Manages precise except. ║
#╚═════════════════════════════════════════╝

class InvalidFileException(Exception):
    def __init__(self, error="unkown", message="Error [10]: File may not be an image, does not exist, is corrupted or has an unsupported format. Pillow exception :"):
        message = ' '.join([message, str(error)])
        super().__init__(message)

class SmallerSlaveException(Exception):
    def __init__(self, message="Error [24]: The slave image is smaller than the master."):
        super().__init__(message)

class OutputNotSetException(Exception):
    def __init__(self, message="Error [31]: output name has not been set."):
        super().__init__(message)

class MasterNotSetException(Exception):
    def __init__(self, message="Error [32]: no Image has been set as master."):
        super().__init__(message)

class NoKeyException(Exception):
    def __init__(self, function="unknown", message="Error [33]: No key has been given to Stegencry before"):
        self.message = ' '.join([message, function, "call."])
        super().__init__(self.message)

class KeyBadFormatException(Exception):
    def __init__(self, message="Error [23]: Key badly formated. A key has to be a string and generated by Stegencry."):
        super().__init__(message)
