From a2f15945bce00886f648648e7803acdf94279dc3 Mon Sep 17 00:00:00 2001 From: funilrys Date: Sat, 15 Oct 2022 14:02:35 +0200 Subject: [PATCH] Improvement of exception handling around proxies. This patch fixes #303. Indeed, before this patch, we were rising exceptions to prevent unknown safe. This patch simply remove those exceptions because the following conditions already handle a broad scopes of possible problems. Contributors: * @spirillen --- PyFunceble/query/requests/adapter/base.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/PyFunceble/query/requests/adapter/base.py b/PyFunceble/query/requests/adapter/base.py index f2f7b3673..1380e28ec 100644 --- a/PyFunceble/query/requests/adapter/base.py +++ b/PyFunceble/query/requests/adapter/base.py @@ -123,12 +123,6 @@ def extract_extension(subject: str) -> Optional[str]: When the given :code:`subject` is an empty :py:class:`str`. """ - if not isinstance(subject, str): - raise TypeError(f" should be {str}, type(subject) given.") - - if not subject: - raise ValueError(" should not be empty.") - if "." not in subject: return None @@ -177,12 +171,6 @@ def correct_input(pattern_input: dict) -> dict: return result - if not isinstance(subject, str): - raise TypeError(f" should be {str}, type(subject) given.") - - if not subject: - raise ValueError(" should not be empty.") - extension = self.extract_extension(subject) proxies = {}