From 471c07122dd2e1b57b230eb7a78a4f2f5b9348a1 Mon Sep 17 00:00:00 2001 From: dece Date: Wed, 4 Jan 2023 00:09:06 +0100 Subject: [PATCH] protocol: catch create_connection UnicodeErrors --- bebop/protocol.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bebop/protocol.py b/bebop/protocol.py index 3cabbeb..dea7266 100644 --- a/bebop/protocol.py +++ b/bebop/protocol.py @@ -153,6 +153,11 @@ class Request: self.state = Request.STATE_CONNECTION_FAILED self.error = exc.strerror return False + except ValueError as exc: + self.state = Request.STATE_INVALID_URL + self.error = "Some connection parameter is wrong, check again." + logging.error(f"ValueError during connection creation: {exc}") + return False # Setup TLS. context = Request.get_ssl_context()