Skip to content

Commit

Permalink
Handle bad trustedpeer setting
Browse files Browse the repository at this point in the history
  • Loading branch information
g1itch committed Jun 7, 2019
1 parent f868c1a commit 29f9cd9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/helper_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ def _loadTrustedPeer():
# This probably means the trusted peer wasn't specified so we
# can just leave it as None
return

host, port = trustedPeer.split(':')
try:
host, port = trustedPeer.split(':')
except ValueError:
sys.exit(
'Bad trustedpeer config setting! It should be set as'
' trustedpeer=<hostname>:<portnumber>'
)
state.trustedPeer = state.Peer(host, int(port))


Expand Down

0 comments on commit 29f9cd9

Please sign in to comment.