Skip to content

Conversation

@ItsDrike
Copy link
Contributor

Closes #189

As shown in the issue, not having any checks for valid values of the server's address can lead to the instance being made without any hint of an error, even though it has unexpected internal values which will be causing issues later. Whenever this happens, since the error will only appear in later usage of this instance, It will not be easy to recognize what's going on. To prevent this, this PR adds a function which simply raises an exception during initialization if the values aren't valid, therefore preventing even the creation of an instance with invalid values.

Note: I've also used regex to ensure that the host address is valid, however I'm not entirely sure if this pattern catches all possible host values correctly, so please make sure to test this before approving the PR.

ItsDrike and others added 2 commits January 26, 2022 14:25
Co-authored-by: Kevin Tindall <kevinkjt2000@users.noreply.github.com>
Source: https://stackoverflow.com/a/106223/2607949

Co-authored-by: Kevin Tindall <kevinkjt2000@users.noreply.github.com>
@kevinkjt2000 kevinkjt2000 merged commit a437042 into Dinnerbone:master Jan 27, 2022
@kevinkjt2000
Copy link
Collaborator

Thanks again!

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

Successfully merging this pull request may close these issues.

TypeError: an integer is required (got type NoneType)

2 participants