Throw an error if user put an invalid port range in config file

Fix #117
This commit is contained in:
Julien Duponchelle
2015-05-06 10:40:51 +02:00
parent 3ba4789ba6
commit ed39afbf3d
3 changed files with 12 additions and 2 deletions

View File

@ -140,7 +140,7 @@ class PortManager:
"""
if end_port < start_port:
raise Exception("Invalid port range {}-{}".format(start_port, end_port))
raise HTTPConflict(text="Invalid port range {}-{}".format(start_port, end_port))
if socket_type == "UDP":
socket_type = socket.SOCK_DGRAM