import pickle


def loadData(file_model):
    """
    Load object from (pk) dump file
    :param file_model: object file
    :return: reconstructed object file
    """
    object_file = None
    try:
        object_file = open(file_model, 'rb')
        object_model = pickle.load(object_file)
        object_file.close()
        return object_model
    except FileNotFoundError:
        print("FATAL ERROR: file does not exist in the given destination.")
        exit()
    except Exception:
        print("FATAL ERROR: pickle file is invalid or corrupted.")
        exit()