Skip to content

Commit

Permalink
Catch only NotFound exception
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 15, 2021
1 parent 79d9ff6 commit b19639e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plex_trakt_sync/commands/plex_login.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from http.client import RemoteDisconnected
from typing import List

import click
from click import Choice
from plexapi.exceptions import Unauthorized
from plexapi.exceptions import Unauthorized, NotFound
from plexapi.myplex import MyPlexAccount, MyPlexResource
from plexapi.server import PlexServer
from urllib3.exceptions import ConnectTimeoutError

from plex_trakt_sync.config import CONFIG
from plex_trakt_sync.style import prompt, error, success, title, comment
Expand Down Expand Up @@ -110,7 +108,7 @@ def choose_server(account: MyPlexAccount):
# Validate connection again, the way we connect
plex = PlexServer(token=server.accessToken, baseurl=plex._baseurl)
return [server, plex]
except (ConnectTimeoutError, RemoteDisconnected, Exception) as e:
except NotFound as e:
click.secho(f"{e}, Try another server, {type(e)}")


Expand Down

0 comments on commit b19639e

Please sign in to comment.