Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 4adfb80

Browse files
committed
Ignore requests.ConnectionError on patched ASM URL
Part of #260.
1 parent d43af54 commit 4adfb80

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

skpy/msg.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import time
66

77
from bs4 import BeautifulSoup, Tag
8+
from requests import ConnectionError as RequestsConnectionError
89

910
from .core import SkypeObj, SkypeEnum, SkypeApiException
1011
from .util import SkypeUtils
@@ -607,10 +608,14 @@ def fileContent(self):
607608
try:
608609
return self.skype.conn("GET", self.urlContent,
609610
auth=SkypeConnection.Auth.Authorize).content
610-
except SkypeApiException:
611-
# Try retrieving via the patched ASM URL instead.
612-
return self.skype.conn("GET", self.urlContentAsm,
613-
auth=SkypeConnection.Auth.Authorize).content
611+
except SkypeApiException as e:
612+
try:
613+
# Try retrieving via the patched ASM URL instead.
614+
return self.skype.conn("GET", self.urlContentAsm,
615+
auth=SkypeConnection.Auth.Authorize).content
616+
except RequestsConnectionError:
617+
# Likely the subdomain doesn't exist; re-raise the original error.
618+
raise e
614619

615620
@property
616621
def html(self):

0 commit comments

Comments
 (0)