{"action":"created","issue":{"url":"https://api.github.com/repos/jpfuentes2/php-activerecord/issues/512","labels_url":"https://api.github.com/repos/jpfuentes2/php-activerecord/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/jpfuentes2/php-activerecord/issues/512/comments","events_url":"https://api.github.com/repos/jpfuentes2/php-activerecord/issues/512/events","html_url":"https://github.com/jpfuentes2/php-activerecord/issues/512","id":92192765,"number":512,"title":"Dealing with PDO DB connection exception","user":{"login":"ajanini","id":3225794,"avatar_url":"https://avatars.githubusercontent.com/u/3225794?v=3","gravatar_id":"","url":"https://api.github.com/users/ajanini","html_url":"https://github.com/ajanini","followers_url":"https://api.github.com/users/ajanini/followers","following_url":"https://api.github.com/users/ajanini/following{/other_user}","gists_url":"https://api.github.com/users/ajanini/gists{/gist_id}","starred_url":"https://api.github.com/users/ajanini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajanini/subscriptions","organizations_url":"https://api.github.com/users/ajanini/orgs","repos_url":"https://api.github.com/users/ajanini/repos","events_url":"https://api.github.com/users/ajanini/events{/privacy}","received_events_url":"https://api.github.com/users/ajanini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-30T20:32:14Z","updated_at":"2015-07-01T12:17:28Z","closed_at":null,"body":"When the PDO connection to the database fails, a `PDOException` is thrown that shows the password in plaintext (you can test this by typing an incorrect username or password).\r\n\r\nI've tried setting `PDO::ATTR_ERRMODE` to `PDO::ERRMODE_SILENT` in `Connection.php` file, and that doesn't seem to help.\r\n\r\nI've also tried to turn off PHP error reporting, but I can't seem to prevent the exception trace info printed to the browser.\r\n\r\nImplementing `try`/`catch` blocks in every query seems very unpractical.\r\n\r\nHave I overlooked something? How should I deal with this problem?"},"comment":{"url":"https://api.github.com/repos/jpfuentes2/php-activerecord/issues/comments/117637891","html_url":"https://github.com/jpfuentes2/php-activerecord/issues/512#issuecomment-117637891","issue_url":"https://api.github.com/repos/jpfuentes2/php-activerecord/issues/512","id":117637891,"user":{"login":"ajanini","id":3225794,"avatar_url":"https://avatars.githubusercontent.com/u/3225794?v=3","gravatar_id":"","url":"https://api.github.com/users/ajanini","html_url":"https://github.com/ajanini","followers_url":"https://api.github.com/users/ajanini/followers","following_url":"https://api.github.com/users/ajanini/following{/other_user}","gists_url":"https://api.github.com/users/ajanini/gists{/gist_id}","starred_url":"https://api.github.com/users/ajanini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajanini/subscriptions","organizations_url":"https://api.github.com/users/ajanini/orgs","repos_url":"https://api.github.com/users/ajanini/repos","events_url":"https://api.github.com/users/ajanini/events{/privacy}","received_events_url":"https://api.github.com/users/ajanini/received_events","type":"User","site_admin":false},"created_at":"2015-07-01T12:17:28Z","updated_at":"2015-07-01T12:17:28Z","body":"Hi @visavi, thanks for your help.\r\n\r\nCould you give me some more info. For instance: I am calling a static method `::all()`. I can't use `$this` in that context.\r\n\r\nAlso, I am trying to suppress the error. Shouldn't the option be `PDO::ERRMODE_SILENT`?\r\n\r\nInvoking `setAttribute` is different than setting this option directly in `Connection.php` file? I've tried that with no luck.\r\n\r\nLike I said, I've tried to *turn off* error reporting in PHP, but that error *continues* to be printed."}}