Interrupt if unable to start webapp
This commit is contained in:
parent
e6ed4176ad
commit
e0f1199768
@ -14,7 +14,7 @@ __author__ = "Davide Testa"
|
||||
__email__ = "davide@davte.it"
|
||||
__credits__ = ["Marco Origlia", "Nick Lee @Nickoala"]
|
||||
__license__ = "GNU General Public License v3.0"
|
||||
__version__ = "2.2.5"
|
||||
__version__ = "2.2.6"
|
||||
__maintainer__ = "Davide Testa"
|
||||
__contact__ = "t.me/davte"
|
||||
|
||||
|
@ -2272,7 +2272,11 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
||||
cls.runner = web.AppRunner(cls.app)
|
||||
await cls.runner.setup()
|
||||
cls.server = web.TCPSite(cls.runner, cls.local_host, cls.port)
|
||||
await cls.server.start()
|
||||
try:
|
||||
await cls.server.start()
|
||||
except OSError as e:
|
||||
logging.error(e)
|
||||
raise KeyboardInterrupt("Unable to start web app.")
|
||||
logging.info(f"App running at http://{cls.local_host}:{cls.port}")
|
||||
|
||||
@classmethod
|
||||
|
Loading…
x
Reference in New Issue
Block a user