Hey guys,
I can't find a good snippet to check whether an php error has occurred (maybe warning and notices too).
I'm doing this for codeIgniter. I'm trying to prevent my template/view from rendering if an error has occured because my css file messes up the codeigniter's error message format. It just looks tacky.
error_get_last( ) just gets the last error which with code igniter is some timezone issue. Also, self explanatory, it gets the last error, how do I know other errors didn't occur before this one?
as a temporary solution before I render the view, i'm doing a ob_end_flush() and then check if headers_sent().
is there a better way? I don't want to create my own error handler.
Thanks,
Dan
EDIT: Actually my solution above turned out to be wrong too. ob_end_flush() sends headers so, my template never renders.
I can't find a good snippet to check whether an php error has occurred (maybe warning and notices too).
I'm doing this for codeIgniter. I'm trying to prevent my template/view from rendering if an error has occured because my css file messes up the codeigniter's error message format. It just looks tacky.
error_get_last( ) just gets the last error which with code igniter is some timezone issue. Also, self explanatory, it gets the last error, how do I know other errors didn't occur before this one?
as a temporary solution before I render the view, i'm doing a ob_end_flush() and then check if headers_sent().
is there a better way? I don't want to create my own error handler.
Thanks,
Dan
EDIT: Actually my solution above turned out to be wrong too. ob_end_flush() sends headers so, my template never renders.
Comment