Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

PHP Fatal error: Cannot access protected property Exception::$message in /var/www/tonicdns/TonicDNS/classes/AuthenticationResource.class.php on line 54 #24

Closed
gfdsa opened this issue Mar 31, 2013 · 2 comments

Comments

@gfdsa
Copy link

gfdsa commented Mar 31, 2013

Just cloned from master today, when it fails to connect to the PDO database for authentication catching exception doesn't work as it should:

[Sun Mar 31 13:06:54 2013] [error] [client ] PHP Stack trace:
[Sun Mar 31 13:06:54 2013] [error] [client ] PHP 1. {main}() /var/www/tonicdns/TonicDNS/docroot/dispatch.php:0
[Sun Mar 31 13:06:54 2013] [error] [client ] PHP 2. Request->loadResource() /var/www/tonicdns/TonicDNS/docroot/dispatch.php:26
[Sun Mar 31 13:06:54 2013] [error] [client ] PHP 3. AuthenticationResource->__construct() /var/www/tonicdns/TonicDNS/lib/tonic.php:557

if i remove ->message:
PHP Fatal error: exception 'Exception' with message 'Failed to open database connection' in /var/www/tonicdns/TonicDNS/lib/pdo_token_backend.php:71\nStack trace:\n#0 /var/www/tonicdns/TonicDNS/classes/AuthenticationResource.class.php(47): PDOTokenBackend->__construct()\n#1 /var/www/tonicdns/TonicDNS/lib/tonic.php(557): AuthenticationResource->__construct(Array)\n#2 /var/www/tonicdns/TonicDNS/docroot/dispatch.php(26): Request->loadResource()\n#3 {main} in /var/www/tonicdns/TonicDNS/classes/AuthenticationResource.class.php on line 55

@gfdsa
Copy link
Author

gfdsa commented Mar 31, 2013

also to save some guessing to the folk, including the real problem is always useful:
throw new Exception("Failed to open database connection: $e");

@LordGaav
Copy link
Member

You're right, I made a wrong reference to the Exception message. Fixed in 23e302f and 78a8e8c.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants