Skip to content

Commit 755860c

Browse files
committed
check the path before attempting to start the server
1 parent cc9eee8 commit 755860c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

browsermobproxy/server.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from subprocess import Popen, PIPE, STDOUT
23
import socket
34
import time
@@ -25,6 +26,10 @@ def __init__(self, path, options={}):
2526
if not path.endswith('.bat'):
2627
path += '.bat'
2728

29+
if not os.path.isfile(path):
30+
raise Exception("Browsermob-Proxy binary couldn't be found in path"
31+
" provided: %s" % path)
32+
2833
self.path = path
2934
self.port = options.get('port', 8080)
3035

0 commit comments

Comments
 (0)