Skip to content

Commit

Permalink
Do not use bare "except" (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
MP3Martin authored Jan 7, 2024
1 parent d421a19 commit 23407bc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ngrok_info/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def gtngr_do_not_use_for_urself():
for i in res_json["tunnels"]:
if i['name'] == tunnel_name:
return i['public_url']
except:
except Exception:
err = True
return None

Expand Down Expand Up @@ -111,13 +111,13 @@ def gtfun(tnl_nm="command_line"):
tcp = 1
else:
tcp = 0
except:
except Exception:
err_gtngr_do_not_use_for_urself()

if tcp == 1:
try:
ngr = ngr.replace("tcp://", "")
except:
except Exception:
err = True
err_gtngr_do_not_use_for_urself()
if not err:
Expand All @@ -127,7 +127,7 @@ def gtfun(tnl_nm="command_line"):
tnl_type = "TCP"
try:
ip = socket.gethostbyname(address)
except:
except Exception:
ip = "ERR NO CONNECTION"
tnl_type = "TCP (no connection)"
tnl_name = par_tnl
Expand All @@ -142,15 +142,15 @@ def gtfun(tnl_nm="command_line"):
if tcp == 0:
try:
ngr = ngr.replace("https://", "")
except:
except Exception:
err = True
err_gtngr_do_not_use_for_urself()
if not err:
adress = address = ngr
tnl_type = "HTTPS"
try:
ip = socket.gethostbyname(address)
except:
except Exception:
ip = "ERR NO CONNECTION"
tnl_type = "HTTPS (no connection)"
tnl_name = par_tnl
Expand Down

0 comments on commit 23407bc

Please sign in to comment.