Welcome Guest, Not a member yet? Register   Sign In
Exception Handling (try...catch blocks)
#1

[eluser]Stefan Hueg[/eluser]
Hey there, is anybody able to help me with proper exception handling in CodeIgniter? Libraries like the native ones from Dropbox or Google Drive throw Exceptions which I'm unable to handle. No matter how I wrap them in try...catch blocks, the Exceptions never get caught and so I end up with "uncaught exception" messages. Even this simple example does not work:

Code:
class Test extends CI_Controller
{
    function index()
    {
     try {
      throw new Exception('Test');
     } catch (Exception $e) {
      //...do stuff
     }
   }
}

----

set_exception_handler() is not an option as I want to wrap function calls in try ... catch blocks, not "handle" them globally.

Due to this problem, I can't use any libraries that use Exceptions for error handling instead of return values. Rewriting the libraries on my own is not an option.

Any suggestions?
#2

[eluser]Stefan Hueg[/eluser]
This thread can be closed... If anyone is interested, I finally figured out that it's 100% not related to CodeIgniter...

It is caused by eAccelerator....




Theme © iAndrew 2016 - Forum software by © MyBB