Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trakt.init throws JSONDecodeError #146

Open
glensc opened this issue Apr 15, 2021 · 1 comment · May be fixed by #181
Open

trakt.init throws JSONDecodeError #146

glensc opened this issue Apr 15, 2021 · 1 comment · May be fixed by #181

Comments

@glensc
Copy link
Contributor

glensc commented Apr 15, 2021

This code throws JSONDecodeError

trakt.init(client_id='', client_secret='', store=True)

this library should catch and re-throw as an exception owned by this library.

so applications using this library can do "catch all trakt exceptions":

        client_id = click.prompt(PROMPT_TRAKT_CLIENT_ID, type=str)
        client_secret = click.prompt(PROMPT_TRAKT_CLIENT_SECRET, type=str)

        try:
            return trakt.init(client_id=client_id, client_secret=client_secret, store=True)
        except TraktException as e:
            click.echo(error(f"Log in to Trakt failed: {e}, Try again."))
@glensc
Copy link
Contributor Author

glensc commented Oct 23, 2022

Merged in my fork:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant