Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling invalid server address #1069

Open
RastaDill opened this issue Dec 14, 2022 · 0 comments
Open

Handling invalid server address #1069

RastaDill opened this issue Dec 14, 2022 · 0 comments

Comments

@RastaDill
Copy link

Hello.

Description case:

  1. creating the instance Server with invalid address (host)
  2. creating the instance Connection
  3. do the connection bind
  4. recived exception LDAPSocketOpenError with text 'invalid server address'

My concern:
When we call bind we appeal to open in base.py where scanning available addresses and try opened socket.
It is this place raised LDAPSocketOpenError.
The problem is that when we try to get the addresses (method candidate_addresses instance Server) we droped to address_infoin server.py.
We ignore all exception and return empty list. Next step we ignore empty address_info and return empty candidates (in candidate_addresses). Finally we ignored empty candidates and focus only on an empty list of exceptions.

  1. Why data not validating "right now"?
  2. Why no raising expetion if have problem now?
  3. In LDAPSocketOpenError not added invalid address
  4. Maybe should be better add custom exceptions for handling to type and not by substring?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant