Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31d250f commit 2eb5f5eCopy full SHA for 2eb5f5e
1 file changed
lib/utils/api.py
@@ -10,6 +10,7 @@
10
import os
11
import re
12
import shlex
13
+import socket
14
import sqlite3
15
import sys
16
import tempfile
@@ -654,7 +655,13 @@ def server(host="0.0.0.0", port=RESTAPI_SERVER_PORT):
654
655
DataStore.current_db.init()
656
657
# Run RESTful API
- run(host=host, port=port, quiet=True, debug=False)
658
+ try:
659
+ run(host=host, port=port, quiet=True, debug=False)
660
+ except socket.error, ex:
661
+ if "already in use" in getSafeExString(ex):
662
+ logger.error("Address already in use ('%s:%s')" % (host, port))
663
+ else:
664
+ raise
665
666
667
def _client(url, options=None):
0 commit comments