Skip to content

Commit

Permalink
Improvement of exception handling around proxies.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
funilrys committed Oct 15, 2022
1 parent 20d4232 commit a2f1594
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions PyFunceble/query/requests/adapter/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"<subject> should be {str}, type(subject) given.")

if not subject:
raise ValueError("<subject> should not be empty.")

if "." not in subject:
return None

Expand Down Expand Up @@ -177,12 +171,6 @@ def correct_input(pattern_input: dict) -> dict:

return result

if not isinstance(subject, str):
raise TypeError(f"<subject> should be {str}, type(subject) given.")

if not subject:
raise ValueError("<subject> should not be empty.")

extension = self.extract_extension(subject)

proxies = {}
Expand Down

0 comments on commit a2f1594

Please sign in to comment.