mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
New except
This commit is contained in:
parent
4629fbc43a
commit
840d8fd685
@ -152,7 +152,9 @@ class TCPServer:
|
|||||||
# TODO: i18n
|
# TODO: i18n
|
||||||
self.log.error("Cannot bind port")
|
self.log.error("Cannot bind port")
|
||||||
raise e
|
raise e
|
||||||
except BaseException as e:
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
except Exception as e:
|
||||||
self.log.error(f"Error: {e}")
|
self.log.error(f"Error: {e}")
|
||||||
raise e
|
raise e
|
||||||
finally:
|
finally:
|
||||||
|
@ -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('--config', help='Patch to config file.', nargs='?', default=None, type=str)
|
||||||
parser.add_argument('--language', help='Setting localisation.', nargs='?', default=None, type=str)
|
parser.add_argument('--language', help='Setting localisation.', nargs='?', default=None, type=str)
|
||||||
|
|
||||||
run = True
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
from core import Core
|
from core import Core
|
||||||
core = Core()
|
|
||||||
try:
|
try:
|
||||||
core.start()
|
Core().start()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
core.run = False
|
pass
|
||||||
core.stop()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user