Welcome Guest, Not a member yet? Register   Sign In
try catch being ignored
#1

[eluser]Unknown[/eluser]
Excuse me if this is covered elsewhere. I did a cursory search and could not find a reference to the problem I am having.

I have code wrapped in a try/catch block and notied that codeigniter is catching and handling errors before they have a chance to get to my catch.

For instance, I have the following test case:

try
{
list($a,$b) = explode(',','testss');
}
catch (Exception $e)
{
log_message('error', "got error");
return;
}

It throws an error as there is only 1 return value and hence nothing for $b. The problem is, my catch handler is not being hit. Instead, CI throws up the error notice on my page and php keeps chugging. This causes problems for me as I cannot depend on my catch's being called and terminating processing.

The message CI puts up is:

A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 1

Filename: controllers/form_define.php

Line Number: 9



Do I just have a flag turned on somewhere that is causing this? Can I disable this behavior?




Theme © iAndrew 2016 - Forum software by © MyBB