Skip to content

Commit 4ec3858

Browse files
Merge pull request pyppeteer#293 from raymondguo-db/dev
Add HTTPException to caught exceptions in launch
2 parents cd50473 + 0c17cae commit 4ec3858

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyppeteer/launcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import json
1010
from urllib.request import urlopen
1111
from urllib.error import URLError
12+
from http.client import HTTPException
1213
import logging
1314
import os
1415
import os.path
@@ -228,8 +229,8 @@ def get_ws_endpoint(url) -> str:
228229
with urlopen(url) as f:
229230
data = json.loads(f.read().decode())
230231
break
231-
except URLError:
232-
continue
232+
except (URLError, HTTPException):
233+
pass
233234
time.sleep(0.1)
234235

235236
return data['webSocketDebuggerUrl']

0 commit comments

Comments
 (0)