From 1fc3d1bf7ac7239c97fc7bfa2eca8c84a05eb459 Mon Sep 17 00:00:00 2001 From: Justin Emter Date: Thu, 17 Aug 2017 06:56:35 -0700 Subject: [PATCH] Added error handling for when a webserver is already running when starting or re-starting the app. --- src/PseudoDailyScheduleController.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PseudoDailyScheduleController.py b/src/PseudoDailyScheduleController.py index 0aeb1da..41542ed 100644 --- a/src/PseudoDailyScheduleController.py +++ b/src/PseudoDailyScheduleController.py @@ -9,6 +9,7 @@ import thread,SocketServer,SimpleHTTPServer from yattag import Doc from yattag import indent import os, sys +import socket import logging import logging.handlers @@ -112,6 +113,9 @@ class PseudoDailyScheduleController(): core.print_info("Exiting the SET web server...") httpd.socket.close() + except socket.error, exc: + print "Caught exception socket.error : %s" % exc + # handle the rest #except Exception: # print "[*] Exiting the SET web server...\n"