LdapSource: Remove call to undefined fatal_error() function#118
Conversation
|
@ctgraham We are very sorry for not replying to your 3 pull requests. I will take a look at all of them as soon as possible. |
| if (!ldap_start_tls($this->database)) { | ||
| $this->log("Ldap_start_tls failed", 'ldap.error'); | ||
| fatal_error("Ldap_start_tls failed"); | ||
| return $this->disconnect(); |
There was a problem hiding this comment.
I would prefer throwing Exception here over returning false. For example, if it were Mysql connection, it would throw PDOException if it failed to connect to the server.
There was a problem hiding this comment.
Agreed, but nowhere else in this project currently throws an Exception. There are various places in this class where we could:
datasources/Model/Datasource/LdapSource.php
Lines 548 to 549 in 84cc8d0
datasources/Model/Datasource/LdapSource.php
Lines 597 to 598 in 84cc8d0
datasources/Model/Datasource/LdapSource.php
Lines 748 to 749 in 84cc8d0
Shouldn't refactoring to use Exceptions be a different Issue/PR?
There was a problem hiding this comment.
There was a problem hiding this comment.
I'm not seeing the merge conflict for #115. Each of these PRs does have a failed test, but it looked to me like it is all the same failure, outside of the scope of this class:
- XmlrpcSourceTest::testRequest
Failed asserting that -32300 matches expected -32700.
Can you point me to any checks or conflicts that should be addressed?
The function
fatal_error()is not defined; Disconnecting and returning to the caller is probably preferred anyway.