# getresponse/1.4.2/includes/eoi-error-handler.php

GetResponse Forms by Optin Cat, version 1.4.2. 47 lines.

- Page: https://pluginprobe.com/plugins/getresponse/1.4.2/code/includes/eoi-error-handler.php
- Raw: https://pluginprobe.com/plugins/getresponse/1.4.2/raw/includes/eoi-error-handler.php
- Modified: 2015-06-12T09:52:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/getresponse/1.4.2/code/includes/eoi-error-handler.php#L10-L20`.

```php
<?php

class EasyOptInsErrorHandler {
	public $errors = array();
	public $output = array();

	public function capture_start() {
		ob_start();

		set_error_handler( array( $this, 'handle_error' ), E_USER_ERROR );

		add_filter( 'wp_die_handler', array( $this, 'handle_die' ) );
		add_filter( 'wp_die_ajax_handler', array( $this, 'handle_die' ) );
	}

	public function capture_end() {
		ob_end_clean();

		restore_error_handler();

		remove_filter( 'wp_die_handler', array( $this, 'handle_die' ) );
		remove_filter( 'wp_die_ajax_handler', array( $this, 'handle_die' ) );
	}

	public function handle_error( $err_no, $err_str ) {
		$this->output[] = ob_get_clean();
		ob_start();

		$this->errors[] = $err_str;
	}

	public function handle_die() {
		$output = ob_get_clean();
		ob_start();

		$this->output[] = $output;

		return array( $this, 'handle_die_callback' );
	}

	public function handle_die_callback( $message ) {
		$this->errors[] = $message;

		return true;
	}
}

```
