File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -274,16 +274,28 @@ def boot(argv):
274
274
httpd .allow_reuse_address = True
275
275
httpd .daemon_threads = True
276
276
try :
277
+ print ("\n Creating HTTP server..." )
277
278
httpd .server_bind ()
278
279
httpd .server_activate ()
279
- print (" \n " + sys .argv [0 ] + " HTTP server is listening on port " + str (HTTP_PORT ) + "..." )
280
+ print (sys .argv [0 ] + " HTTP server is listening on port " + str (HTTP_PORT ) + "..." )
280
281
httpd .serve_forever ()
281
- except :
282
- pass
282
+ except KeyboardInterrupt as e :
283
+ print ("Interrupted by user..." )
284
+ except Exception as e :
285
+ print (e )
286
+ print (traceback .format_exc ())
283
287
284
- simulator .stop ()
285
- httpd .shutdown ()
286
- httpd .server_close ()
288
+ try :
289
+ print ("Stopping simulator..." )
290
+ simulator .stop ()
291
+ print ("Stopping HTTP server..." )
292
+ httpd .shutdown ()
293
+ httpd .server_close ()
294
+ except Exception as e :
295
+ print (e )
296
+ print (traceback .format_exc ())
297
+
298
+ sys .exit (1 )
287
299
288
300
if __name__ == "__main__" :
289
301
boot (sys .argv )
You can’t perform that action at this time.
0 commit comments