-
Notifications
You must be signed in to change notification settings - Fork 24
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
Incorrect Return Value in readme #105
Comments
C API algorithm:
|
@bigbes If I get it right, the question is why a method returns a boolean value. What is the point of returning |
@rybakit Is that a problem? Seems like something, that won't question anyone. |
@bigbes Imho, the problem that api gives a wrong impression that a user can just check the result of a method call, like: if (!$t->ping()) {
// this block will never be reached
} |
It's not something, that bothers you before? |
@bigbes See this comment: #44 (comment) |
Can you provide PR that will fix README.md? |
Of course, I can update README.md if you are OK to tweak the implementation. |
Implementation is OK, as I've understand, README gives wrong impression. Not? |
Hm, so you propose to modify the documentation to not reflect the real behavior? |
You have told, that this is the real behaviour, not? |
I didn't get your question, sorry. My point (although I'm not alone, as I'm not the one who created this issue /cc @nekufa) that mixing return booleans and exceptions is bad and I've already described and gave an example of why I think the api has the flaw. So, to fix that both the implementation and documentation should be updated to always return void and throw an exception in a case of an error. It doesn't have sense to me to only update the documentation and keep the current behavior. There is nothing much I can add to this discussion, but I hope I was clear enough ;) P.S. I would really appreciate if you can provide me with the links to the docs or libraries which implement this "bool/exceptions" design, I have never seen this before. Maybe this will help me to understand your implementation. |
Hello, i found that readme is incorrect.
There are a lot of comments like bool return "False and raises Exception on error".
It's impossible to return value and raise the exception.
What will happen? False will be returned or exception thrown?
The text was updated successfully, but these errors were encountered: