@param WP_Error $pError

@throws Freemius_Exception
7002
private static function ThrowWPRemoteException( WP_Error $pError ) {
			if ( self::IsCurlError( $pError ) ) {
				$message = $pError->get_error_message( 'http_request_failed' );

				#region Check if there are any missing cURL methods.

				$curl_required_methods = array(
					'curl_version',
					'curl_exec',
					'curl_init',
					'curl_close',
					'curl_setopt',
					'curl_setopt_array',
					'curl_error',
				);

				// Find all missing methods.
				$missing_methods = array();
				foreach ( $curl_required_methods as $m ) {
					if ( ! function_exists( $m ) ) {
						$missing_methods[] = $m;
					}
				}

				if ( ! empty( $missing_methods ) ) {
					throw new Freemius_Exception( array(
						'error'           => (object) array(
							'type'    => 'cUrlMissing',
							'message' => $message,
							'code'    => 'curl_missing',
							'http'    => 402
						),
						'missing_methods' => $missing_methods,
					) );
				}

				#endregion

				// cURL error - "cURL error {{errno}}: {{error}}".
				$parts = explode( ':', substr( $message, strlen( 'cURL error ' ) ), 2 );

				$code    = ( 0 < count( $parts ) ) ? $parts[0] : 'http_request_failed';
				$message = ( 1 < count( $parts ) ) ? $parts[1] : $message;

				$e = new Freemius_Exception( array(
					'error' => array(
						'code'    => $code,
						'message' => $message,
						'type'    => 'CurlException',
					),
				) );
			} else {
				$e = new Freemius_Exception( array(
					'error' => array(
						'code'    => $pError->get_error_code(),
						'message' => $pError->get_error_message(),
						'type'    => 'WPRemoteException',
					),
				) );
			}

			throw $e;
		}
382660
function setError( $errorNumber = 0, $errorDescription = "" )
    {
        $this->ERROR['number'] = $errorNumber;
        $this->ERROR['description'] = $errorDescription;

        switch( $errorNumber )
        {
            case self::ERROR_NOERROR :
                $this->ERROR['value'] = "";
                break;
            case self::ERROR_UNSUPPORTEDTYPE :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "File extension or type is not allowed." );
                break;
            case self::ERROR_PARSEXML :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Could not parse XML." );
                break;
            case self::ERROR_OPENSOCKET :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Can not open socket. Please check if extension/ezodf/daemon.php is running." );
                break;
            case self::ERROR_CONVERT :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Can not convert the given document." );
                break;
            case self::ERROR_DAEMONCALL :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Unable to call daemon. Fork can not create child process." );
                break;
            case self::ERROR_DAEMON :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Daemon reported error." );
                break;
            case self::ERROR_UNKNOWNNODE:
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Unknown node." );
                break;
            case self::ERROR_ACCESSDENIED:
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Access denied." );
                break;
            case self::ERROR_IMPORTING:
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Error during import." );
                break;
            case self::ERROR_UNKNOWNCLASS:
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Unknown content class specified in odf.ini:" );
                break;
            default :
                $this->ERROR['value'] = ezpI18n::tr( 'extension/ezodf/import/error', "Unknown error." );
                break;
        }
    }
390488
public function showError($code, $description = '$'){
        $description = $description == "$" && isset($this->errorMsg[$code]) ? $this->errorMsg[$code] : $description;
        $description .= '['.$code.']';
        throw new Exception($description, 400);
    }
1192217
public function handleError($error = null)
    {
        if ($this->logErrors === true) {
            $this->log($error);
            if ($this->client) {
                $this->log($this->client->__getLastRequest());
            }
        }
        throw new Exception($error);
    }
45707
protected function error(\Exception $error, Context $context = null)
    {
        $exception = get_class($error);
        $this->logger->error($error);

        if($this->catch) {
            foreach($this->errors as $class => $callback) {
                if(is_string($class) and $error instanceof $class) {
                    $context->error = $error;
                    $this->logger->debug('kernel.error: ' . $exception . ' raised, has callback');
                    return $context->forward($callback, $error);
                }
            }
        }

        $this->logger->debug('kernel.error: ' . $exception . ' raised, no callback');
        throw $error;
    }
1063992
public function setError($error)
    {
        if (!$error instanceof \Throwable && !$error instanceof \Exception) {
            throw new InvalidArgumentException(sprintf('The error passed to ConsoleErrorEvent must be an instance of \Throwable or \Exception, "%s" was passed instead.', is_object($error) ? get_class($error) : gettype($error)));
        }

        $this->error = $error;
    }
64101
protected function _tokenError($error = 'tokenNotFound')
    {
        $subject = $this->_subject(['success' => false]);
        $this->_trigger($error, $subject);

        $message = $this->message($error, compact('token'));
        $exceptionClass = $message['class'];
        throw new $exceptionClass($message['text'], $message['code']);
    }
920652
public static function for_error( \WP_Error $error, $channel = '' ) {

		$instance        = new static;
		$instance->error = $error;
		$channel and $instance->channel = (string) $channel;

		return $instance;
	}
955036
public function show_php_error($iSeverity, $sMessage, $sFilePath, $iLine)
    {
        $oErrorHandler = Factory::service('ErrorHandler');
        return $oErrorHandler->triggerError($iSeverity, $sMessage, $sFilePath, $iLine);
    }
1295560
public function addError($error) {
        // Make sure that we don't try to index an error that doesn't
        // contain an index value.
        if ($error->getErrorCode() == null) {
            require_once 'Zend/Gdata/App/Exception.php';
            throw new Zend_Gdata_App_Exception("Error encountered without corresponding error code.");
        }

        $this->_errors[$error->getErrorCode()] = $error;
    }
968343
public static function showError(\Throwable $throwable, int $code = 500, $text = 'Internal Server Error')
    {
        if (Config::application('debug')) {
            /* @noinspection PhpUnusedLocalVariableInspection variable uses in 500.php */
            $error = Html::e($throwable);
        }

        header("HTTP/1.1 $code $text");

        $file = $code . '.php';
        $path = __DIR__ . '/../../../../../../application/views/error/';

        /** @noinspection PhpIncludeInspection */
        include file_exists($path . $file) ? $path . $file : __DIR__ . '/views/' . $file;
    }
661406
public static function from_wp_error( \WP_Error $error, $level = Logger::NOTICE, $channel = '' ) {

		$log_level = LogLevel::instance();
		$level     = $log_level->check_level( $level ) ? : Logger::NOTICE;

		$message = $error->get_error_message();
		$context = $error->get_error_data() ?: [];

		if ( $channel ) {
			return new static( $message, $level, $channel, $context );
		}

		$channel = WpErrorChannel::for_error( $error )
			->channel();

		// Raise level for "guessed" channels
		if ( $channel === Channels::SECURITY && $level < Logger::ERROR ) {
			$level = Logger::ERROR;
		} elseif ( $channel !== Channels::DEBUG && $level < Logger::WARNING ) {
			$level = Logger::WARNING;
		}

		return new static( $message, $level, $channel, $context );
	}
1285136
public function setError($error)
  {
    if ( !($error instanceof Exception) && is_string($error) ){
      $error = new Exception($error);
    }
    
    array_push($this->errors, $error);
    
    return $this;
  }
732623
public function get_wp_error() {
		return $this->wp_error ? $this->wp_error : new \WP_Error( $this->code, $this->message, $this );
	}
1245758
function extendError(pError, error) {
		if (error && (typeof error === 'object')) {
			['name', 'errno'].forEach(function(property) {
				if (property in error) {
					this[property]	= error[property];
				}
			}, pError);
		}

		return pError;
	}
713749
protected function catchError($error){
        if($this->connection->inTransaction()){
            $this->errorTran[]= $error;
            $this->stateTran= FALSE;
        }
        $this->lastError= $error;    
        
    }
375787
static function shoot_ajax_failure( $error = '' ) {
            $result = array( 'success' => false );
            if ( ! empty( $error ) ) {
                $result['error'] = $error;
            }

            wp_send_json( $result );
        }