import json


def read_json(file_path: str) -> dict:
    """
    Function that reads JSON configuration file and returns data.

    >>> from snakypy import helpers
    >>> file = '/tmp/file.json'
    >>> helpers.files.read_json(file)

    Args:
        file_path (str): You must receive the full/absolute file path

    Returns:
        [dict]: If the file is found it will return a dictionary
    """

    try:
        with open(file_path) as f:
            data = json.load(f)
        return data
    except FileNotFoundError as err:
        raise FileNotFoundError(f">>> File not found {err}")
    except json.decoder.JSONDecodeError:
        raise Exception(f">>> Incorrect Json file structure: {file_path}")
    except PermissionError:
        raise PermissionError(
            f"Your user does not have permission to read this file. {file_path}"
        )
    except Exception:
        raise Exception(f">>> There was an error reading the file: {file_path}")