HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //proc/self/cwd/wp-content/plugins/woocommerce-zapier/legacy/Exception/JsonErrorException.php
<?php

namespace OM4\Zapier\Exception;

use OM4\WooCommerceZapier\Exception\BaseException;

defined( 'ABSPATH' ) || exit;

/**
* Exception to trigger when violation of immutable behavior occurs.
 *
 * @deprecated 2.0.0
 */
final class JsonErrorException extends BaseException {

	/**
	 * Construct the exception.
	 *
	 * @link https://php.net/manual/en/exception.construct.php
	 *
	 * @param string $class      The name of the class.
	 * @param int    $last_error JSON last error.
	 * @param int    $code       [optional] The Exception code.
	 */
	public function __construct( $class, $last_error, $code = 0 ) {

		switch ( $last_error ) {
			case constant( 'JSON_ERROR_NONE' ):
				$error_text = 'No error has occurred.';
				break;
			case constant( 'JSON_ERROR_DEPTH' ):
				$error_text = 'Maximum stack depth exceeded.';
				break;
			case constant( 'JSON_ERROR_STATE_MISMATCH' ):
				$error_text = 'Invalid or malformed JSON.';
				break;
			case constant( 'JSON_ERROR_CTRL_CHAR' ):
				$error_text = 'Control character error, possibly incorrectly encoded.';
				break;
			case constant( 'JSON_ERROR_SYNTAX' ):
				$error_text = 'Syntax error.';
				break;
			case constant( 'JSON_ERROR_UTF8' ):
				$error_text = 'Malformed UTF-8 characters, possibly incorrectly encoded';
				break;
			case constant( 'JSON_ERROR_RECURSION' ):
				$error_text = 'One or more recursive references in the value to be encoded.';
				break;
			case constant( 'JSON_ERROR_INF_OR_NAN' ):
				$error_text = 'One or more NAN or INF values in the value to be encoded.';
				break;
			case constant( 'JSON_ERROR_UNSUPPORTED_TYPE' ):
				$error_text = 'A value of a type that cannot be encoded was given.';
				break;
			case constant( 'JSON_ERROR_INVALID_PROPERTY_NAME' ):
				$error_text = 'A property name that cannot be encoded was given.';
				break;
			case constant( 'JSON_ERROR_UTF16' ):
				$error_text = 'Malformed UTF-16 characters, possibly incorrectly encoded.';
				break;
			default:
				$error_text = 'Unknown error';
				break;
		}

		$message = sprintf(
			'Could not create JSON from class %s. %s ',
			$class,
			$error_text
		);
		parent::__construct( $message, $code );
	}
}