opauth/opauth — pull request #63 by rchavik (2013-07-22 05:03:39+00:00)
Title: Check curl errno() and throw Exception

Without this, it may gives seemingly unrelated error as attached below.

The actual error is : "SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed" because I'm running a self-signed certificate on localhost.

That raises another question though: how would we configure the transport setting?

```
Warning: get_class() expects parameter 1 to be object, resource given in /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php on line 579

Call Stack:
0.0003 726248 1. {main}() /home/rachman/work/personal/deploy/croogo/webroot/index.php:0
0.0457 7267832 2. Dispatcher->dispatch() /home/rachman/work/personal/deploy/croogo/webroot/index.php:96
0.0555 8996680 3. Dispatcher->_invoke() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:162
0.1818 20213552 4. Controller->invokeAction() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:187
0.1818 20214608 5. ReflectionMethod->invokeArgs() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Controller.php:486
0.1818 20214664 6. SocialitesUsersController->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:0
0.1825 20300872 7. AuthComponent->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:35
0.1826 20300952 8. AuthComponent->identify() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:547
0.1834 20365240 9. OpauthAuthenticate->authenticate() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:698
0.1840 20485480 10. Opauth\Opauth->run() /home/rachman/work/core/plugins/2.0/socialites/Controller/Component/Auth/OpauthAuthenticate.php:25
0.1852 20714624 11. Opauth\Opauth->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:113
0.1852 20714624 12. Opauth\Strategy\Croogo\Strategy->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:136
0.1853 20716096 13. Opauth\Transport\Base->get() /home/rachman/work/core/plugins/2.0/socialites/Opauth/Strategy/Croogo/Strategy.php:84
0.1853 20717520 14. Opauth\Transport\Curl->request() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Transport/Base.php:68
0.1933 20721144 15. ErrorHandler::handleError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:0
0.1934 20730800 16. Debugger->outputError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:200
0.1987 20761840 17. Debugger::exportVar() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:765
0.1987 20761920 18. Debugger::_export() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:473
0.1988 20762216 19. Debugger::_object() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:504
0.1988 20762744 20. get_class() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:579

Warning: get_object_vars() expects parameter 1 to be object, resource given in /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php on line 585

Call Stack:
0.0003 726248 1. {main}() /home/rachman/work/personal/deploy/croogo/webroot/index.php:0
0.0457 7267832 2. Dispatcher->dispatch() /home/rachman/work/personal/deploy/croogo/webroot/index.php:96
0.0555 8996680 3. Dispatcher->_invoke() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:162
0.1818 20213552 4. Controller->invokeAction() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:187
0.1818 20214608 5. ReflectionMethod->invokeArgs() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Controller.php:486
0.1818 20214664 6. SocialitesUsersController->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:0
0.1825 20300872 7. AuthComponent->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:35
0.1826 20300952 8. AuthComponent->identify() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:547
0.1834 20365240 9. OpauthAuthenticate->authenticate() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:698
0.1840 20485480 10. Opauth\Opauth->run() /home/rachman/work/core/plugins/2.0/socialites/Controller/Component/Auth/OpauthAuthenticate.php:25
0.1852 20714624 11. Opauth\Opauth->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:113
0.1852 20714624 12. Opauth\Strategy\Croogo\Strategy->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:136
0.1853 20716096 13. Opauth\Transport\Base->get() /home/rachman/work/core/plugins/2.0/socialites/Opauth/Strategy/Croogo/Strategy.php:84
0.1853 20717520 14. Opauth\Transport\Curl->request() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Transport/Base.php:68
0.1933 20721144 15. ErrorHandler::handleError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:0
0.1934 20730800 16. Debugger->outputError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:200
0.1987 20761840 17. Debugger::exportVar() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:765
0.1987 20761920 18. Debugger::_export() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:473
0.1988 20762216 19. Debugger::_object() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:504
0.1991 20763104 20. get_object_vars() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:585

Warning: Invalid argument supplied for foreach() in /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php on line 586

Call Stack:
0.0003 726248 1. {main}() /home/rachman/work/personal/deploy/croogo/webroot/index.php:0
0.0457 7267832 2. Dispatcher->dispatch() /home/rachman/work/personal/deploy/croogo/webroot/index.php:96
0.0555 8996680 3. Dispatcher->_invoke() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:162
0.1818 20213552 4. Controller->invokeAction() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:187
0.1818 20214608 5. ReflectionMethod->invokeArgs() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Controller.php:486
0.1818 20214664 6. SocialitesUsersController->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:0
0.1825 20300872 7. AuthComponent->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:35
0.1826 20300952 8. AuthComponent->identify() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:547
0.1834 20365240 9. OpauthAuthenticate->authenticate() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:698
0.1840 20485480 10. Opauth\Opauth->run() /home/rachman/work/core/plugins/2.0/socialites/Controller/Component/Auth/OpauthAuthenticate.php:25
0.1852 20714624 11. Opauth\Opauth->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:113
0.1852 20714624 12. Opauth\Strategy\Croogo\Strategy->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:136
0.1853 20716096 13. Opauth\Transport\Base->get() /home/rachman/work/core/plugins/2.0/socialites/Opauth/Strategy/Croogo/Strategy.php:84
0.1853 20717520 14. Opauth\Transport\Curl->request() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Transport/Base.php:68
0.1933 20721144 15. ErrorHandler::handleError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:0
0.1934 20730800 16. Debugger->outputError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:200
0.1987 20761840 17. Debugger::exportVar() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:765
0.1987 20761920 18. Debugger::_export() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:473
0.1988 20762216 19. Debugger::_object() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:504

Warning: ReflectionObject::__construct() expects parameter 1 to be object, resource given in /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php on line 592

Call Stack:
0.0003 726248 1. {main}() /home/rachman/work/personal/deploy/croogo/webroot/index.php:0
0.0457 7267832 2. Dispatcher->dispatch() /home/rachman/work/personal/deploy/croogo/webroot/index.php:96
0.0555 8996680 3. Dispatcher->_invoke() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:162
0.1818 20213552 4. Controller->invokeAction() /home/rachman/work/core/cake_2.0/lib/Cake/Routing/Dispatcher.php:187
0.1818 20214608 5. ReflectionMethod->invokeArgs() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Controller.php:486
0.1818 20214664 6. SocialitesUsersController->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:0
0.1825 20300872 7. AuthComponent->login() /home/rachman/work/core/plugins/2.0/socialites/Controller/SocialitesUsersController.php:35
0.1826 20300952 8. AuthComponent->identify() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:547
0.1834 20365240 9. OpauthAuthenticate->authenticate() /home/rachman/work/core/cake_2.0/lib/Cake/Controller/Component/AuthComponent.php:698
0.1840 20485480 10. Opauth\Opauth->run() /home/rachman/work/core/plugins/2.0/socialites/Controller/Component/Auth/OpauthAuthenticate.php:25
0.1852 20714624 11. Opauth\Opauth->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:113
0.1852 20714624 12. Opauth\Strategy\Croogo\Strategy->callback() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Opauth.php:136
0.1853 20716096 13. Opauth\Transport\Base->get() /home/rachman/work/core/plugins/2.0/socialites/Opauth/Strategy/Croogo/Strategy.php:84
0.1853 20717520 14. Opauth\Transport\Curl->request() /home/rachman/work/core/plugins/2.0/socialites/Vendor/opauth/opauth/lib/Opauth/Transport/Base.php:68
0.1933 20721144 15. ErrorHandler::handleError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:0
0.1934 20730800 16. Debugger->outputError() /home/rachman/work/core/cake_2.0/lib/Cake/Error/ErrorHandler.php:200
0.1987 20761840 17. Debugger::exportVar() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:765
0.1987 20761920 18. Debugger::_export() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:473
0.1988 20762216 19. Debugger::_object() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:504
0.1995 20764192 20. ReflectionObject->__construct() /home/rachman/work/core/cake_2.0/lib/Cake/Utility/Debugger.php:592
```