import json
import logging


def parseJSON(file_path: str) -> dict:
    """Function to parse a JSON file.
    
    Arguments:
        file_path {str} -- File path of target JSON file.
    
    Raises:
        FileNotFoundError -- Raised if the target file is not found.
        JSONDecodeError -- Raised if there is an error parsing the JSON file.
    
    Returns:
        dict -- Dictionary of parsed JSON file contents.
    """

    try:
        data_str = open(file_path).read()
        data_parsed = json.loads(data_str)
        return data_parsed
    except FileNotFoundError as e:
        logging.error('File %s not found' % file_path)
        logging.error(e)
        raise e
    except json.decoder.JSONDecodeError as e:
        logging.error('Error parsing JSON file %s' % file_path)
        logging.error(e)
        raise e