class InvalidFileExtension(Exception):

    def __init__(self, file_name, valid_extensions):
        msg = 'Invalid file extension: {file_name}. Use {valid_extensions}'.format(
            file_name=file_name,
            valid_extensions=', '.join(valid_extensions),
        )
        super().__init__(msg)
        self.message = msg
