Exceptional::handle_exception PHP Method

handle_exception() static public method

* Exception handle class. Pushes the current exception onto the exception stack and calls the previous handler, if it exists. Ensures seamless integration.
static public handle_exception ( $exception, $call_previous = true )
    static function handle_exception($exception, $call_previous = true)
    {
        self::$exceptions[] = $exception;
        if (Exceptional::$api_key != null) {
            $data = new ExceptionalData($exception);
            ExceptionalRemote::send_exception($data);
        }
        // if there's a previous exception handler, we call that as well
        if ($call_previous && self::$previous_exception_handler) {
            call_user_func(self::$previous_exception_handler, $exception);
        }
    }