/** * This error handler exists only to capture warnings and ensure they get * passed to user. * * Otherwise warnings would either get hidden or printed before returning JSON object * and breaking the api. This allows the api to function regardless. * * Also, we are still in BETA and we want information about * errors, not just to hide them. Normal exceptions are passed on as usual. * * @param unknown $errno * @param unknown $errstr * @param unknown $errfile * @param unknown $errline * @throws ErrorException * @return boolean */ public static function handleError($errno, $errstr, $errfile, $errline) { //trap warnings also switch ($errno) { case E_WARNING: case E_NOTICE: case E_USER_NOTICE: case E_USER_WARNING: throw new ErrorException(Controller::errMsg($errstr, $errline, $errfile), 0, $errno, $errfile, $errline); } return false; }