New except

This commit is contained in:
Maxim Khomutov 2023-07-15 15:36:59 +03:00
parent 4629fbc43a
commit 840d8fd685
2 changed files with 5 additions and 7 deletions

View File

@ -152,7 +152,9 @@ class TCPServer:
# TODO: i18n
self.log.error("Cannot bind port")
raise e
except BaseException as e:
except KeyboardInterrupt:
pass
except Exception as e:
self.log.error(f"Error: {e}")
raise e
finally:

View File

@ -14,17 +14,13 @@ parser.add_argument('-v', '--version', action="store_true", help='Print version
parser.add_argument('--config', help='Patch to config file.', nargs='?', default=None, type=str)
parser.add_argument('--language', help='Setting localisation.', nargs='?', default=None, type=str)
run = True
def main():
from core import Core
core = Core()
try:
core.start()
Core().start()
except KeyboardInterrupt:
core.run = False
core.stop()
pass
if __name__ == '__main__':