Error Handling with PHP
Posted: Wed Nov 01, 2006 2:39 pm
i need to be able to do two things and i'm getting a little stuck here.
first i'm trying to catch the error that PHP is throwing in global space. i want to catch that, find what the error is and then use my functions to handle that error gracefully instead of breaking out of the application completley.
secondly i wanted to be able to set error handling per users/admins. depending on the permissions set.
ok, the first i have no idea how to do. maybe
the first thing that i'm doing is setting up an array of error values.
then i wanted to catch that in global space. does anyone know how to do this?
thanks for your help
first i'm trying to catch the error that PHP is throwing in global space. i want to catch that, find what the error is and then use my functions to handle that error gracefully instead of breaking out of the application completley.
secondly i wanted to be able to set error handling per users/admins. depending on the permissions set.
ok, the first i have no idea how to do. maybe
Code: Select all
ini_get("error_reporting");Code: Select all
$levels = array(
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parsing Error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core Error',
E_CORE_WARNING => 'Core Warning',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Runtime Notice'
);thanks for your help