def errorMessage(err, location = None):
    """
    Generate a standard error message.

    Parameters
    ----------
    err : str
        The error message.
    location : str, optional
        Where the error happens. E.g. CTL.funcs.funcs.errorMessage
    
    Returns
    -------
    str
        The generated error message.
    """
    if (location is None):
        return "Error: {}".format(err)
    else:
        return "Error in {}: {}".format(location, err)