/** * Custom Exception Handler * * @param Exception $e Exception Object * @return void */ public static function exception_handler($e) { $exceptions = get_site_option(AI1WM_EXCEPTION_HANDLER, array()); // Limit errors if (count($exceptions) > self::EXCEPTION_LIMIT) { array_shift($exceptions); } // Add exception $exceptions[] = array('code' => $e->getCode(), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine(), 'time' => time()); Ai1wm_Logger::error(AI1WM_EXCEPTION_HANDLER, $exceptions); }