def get_token_from_secret_file(secret_file_path, error):
    'Read secret file to obtain access token.'
    try:
        with open(secret_file_path, 'r') as f:
            return f.readline()
    except FileNotFoundError:
        error('Secret file not found')
    except PermissionError:
        error('No permissions to read secret file')
Read secret file to obtain access token.
def get_token_from_secret_file(secret_file_path, error):
    
    try:
        with open(secret_file_path, 'r') as f:
            return f.readline()
    except FileNotFoundError:
        error('Secret file not found')
    except PermissionError:
        error('No permissions to read secret file')