import json


def readConfig(fileName):
    """Reads the JSON based configuration file and returns its contents as a dictionary."""
    try:
        with open(fileName, 'r') as configFile:
            configuration = json.load(configFile)
            return configuration

    except FileNotFoundError:
        print("Configuration file {} not found.".format(fileName))
        return None

    except json.decoder.JSONDecodeError as error:
        print("Unable to parse JSON from configuration file: {}.".format(str(error)))
        return None