Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _start_server(self):
try:
self._prepare_webhook_server()
self._load_webhook_routes()
self.ngrok_public_url = self.connect(self.webhook_port, protocol="http")
self.webhook_public_url = f"{self.ngrok_public_url}/webhook"
if self.webhook_server:
self.connected = True
self.webhook_server.serve_forever()
except PyngrokNgrokError as e:
self.logger.error(f"Error when starting webhook service: Your ngrock.com token might be invalid. ({e})")
except Exception as e:
self.logger.exception(e, True, f"Error when running webhook service: ({e})")
self.connected = False