build the html message

@param Html2PdfException $e    the exception of the error
@param array             $data additional data

@return void
963902
protected function buildHtmlMessage(Html2PdfException $e, $data)
    {
        $this->htmlMessage = '<span style="color: #A00; font-weight: bold;">';
        $this->htmlMessage.= 'Html2Pdf Error ['.$e->getCode().']';
        $this->htmlMessage.= '</span><br />'."\n";
        $this->htmlMessage.= htmlentities($e->getMessage())."<br />\n";
        $this->htmlMessage.= ' File: '.$e->getFile()."<br />\n";
        $this->htmlMessage.= ' Line: '.$e->getLine()."<br />\n";

        if (!empty($data)) {
            foreach ($data as $key => $value) {
                $this->htmlMessage .= ' '.ucwords($key).': '.trim(htmlentities($value))."<br />\n";
            }
        }
    }
1227028
public function fail(\Exception $e)
    {
        $this->stopped();

        $this->setStatus(Job::STATUS_FAILED, $e);

        // For the failed jobs we store a lot more data for debugging
        $packet = $this->getPacket();
        $failed_payload = array_merge(json_decode($this->payload, true), array(
            'worker'    => $packet['worker'],
            'started'   => $packet['started'],
            'finished'  => $packet['finished'],
            'output'    => $packet['output'],
            'exception' => (array)json_decode($packet['exception'], true),
        ));
        $this->redis->zadd(Queue::redisKey($this->queue, 'failed'), time(), json_encode($failed_payload));
        Stats::incr('failed', 1);
        Stats::incr('failed', 1, Queue::redisKey($this->queue, 'stats'));

        Event::fire(Event::JOB_FAILURE, array($this, $e));
    }
941225
public function logException($e) {
		if(!$this->isLogging())
			return;

		#PSRException with a given severity
		if($e instanceof PSRException) {
			$severity = $e->getseverity();
			$msg = $e->getMessage();
		}
		#PHP exception
		elseif($e instanceof \ErrorException) {
			$severity = static::getPHPErrorSeverity($e->getCode());
			$msg = 'PHP ('.static::getPHPError($e->getCode()).'): '.$e->getMessage();
		}
		#other exception
		else {
			$severity = \Psr\Log\LogLevel::ERROR;
			$msg = get_class($e).': '.$e->getMessage();
		}

		$trace = $this->getBacktraceFromException($e);

		$this->log($severity, $msg, $e->getFile(), $e->getLine(), $e, $trace);
	}
124936
public function render($request, Exception $e)
    {
        //        if ($request->isXmlHttpRequest())
//            return $this->renderXmlHttpException($e);

        if (config('app.debug')) {
            if ($request->isXmlHttpRequest()) {
                return $this->renderDebugXmlHttpException($e);
            }

            return $this->renderExceptionWithWhoops($e);
        }

        return parent::render($request, $e);
    }
911449
public function message(RouteException $e) {
    $message = $this->getConfig('message', $e);
    if (!empty($message) && PHP_SAPI !== 'cli') {
      drupal_set_message($message, 'error');
    }
  }
1170323
public function feedPDOException(\PDOException $e) {
		$this->errorInfo = $e->errorInfo;
		$this->message = $e->getMessage();
		$this->code = $e->getCode();
		$this->file = $e->getFile();
		$this->line = $e->getLine();
		return $this;
	}
204418
public function CreateElementHtml($data){
		PhpWsdl::Debug('CreateElementHtml for '.$data['element']->Name);
		$res=&$data['res'];
		$e=&$data['element'];
		if(in_array($e->Type,PhpWsdl::$BasicTypes)){
			$res[]='<li><span class="blue">'.$e->Type.'</span> <span class="bold">'.$e->Name.'</span>';
		}else{
			$res[]='<li><a href="#'.$e->Type.'"><span class="lightBlue">'.$e->Type.'</span></a> <span class="bold">'.$e->Name.'</span>';
		}
		$o=sizeof($res)-1;
		$temp=Array(
			'nillable = <span class="blue">'.(($e->NillAble)?'true':'false').'</span>',
			'minoccurs = <span class="blue">'.$e->MinOccurs.'</span>',
			'maxoccurs = <span class="blue">'.$e->MaxOccurs.'</span>',
		);
		$res[$o].=' ('.implode(', ',$temp).')';
		if(!is_null($e->Docs))
			$res[$o].='<br><span class="normal">'.nl2br(htmlentities($e->Docs)).'</span>';
		$res[$o].='</li>';
		PhpWsdl::CallHook(
			'CreateElementHtmlHook',
			$data
		);
	}
649794
private function message(\Exception $e) {
		/** @var bool $isShipping */
		$isShipping = df_ets($e) === (string)__('Please specify a shipping method.');
		/** @var bool $isSpecific */
		if (!($isSpecific = $e instanceof DFPE)) {
			$e = df_ef($e);
		}
		if (!$isShipping) {
			df_log($e);
		}
		/** @var string $mc */
		/** @var string $md */
		list($mc, $md) =
			$isSpecific
			? [$e->messageC(), df_tag_if($e->messageD(), $e->isMessageHtml(), 'pre')]
			: [dfp_error_message(), df_etsd($e)]
		;
		return !$this->s()->test() ? $mc : df_cc_br($mc, __('Debug message:'), $md);
	}
1215372
public function print(ValidationFailedException $e, OutputInterface $output) {

		$table = new Table($output);
		$table->setHeaders( ['Field', 'Problem'] );

		$i = 0;
		foreach( $e->getFailures() as $field => $messages ) {
			foreach($messages as $message)
				$table->setRow( $i++, [$field, $message] );

		}

		$table->render();
	}
600514
public function renderException(\Exception $e, OutputInterface $output)
    {
        $output->writeln('', OutputInterface::VERBOSITY_QUIET);

        do {
            $title = sprintf(
                '  [%s%s]  ',
                get_class($e),
                $output->isVerbose() && 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''
            );

            $len = Helper::strlen($title);

            $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
            // HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
            if (defined('HHVM_VERSION') && $width > 1 << 31) {
                $width = 1 << 31;
            }
            $lines = array();
            foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
                foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
                    // pre-format lines to get the right string length
                    $lineLength = Helper::strlen($line) + 4;
                    $lines[] = array($line, $lineLength);

                    $len = max($lineLength, $len);
                }
            }

            $messages = array();
            $messages[] = $emptyLine = sprintf('<error>%s</error>', str_repeat(' ', $len));
            $messages[] = sprintf('<error>%s%s</error>', $title, str_repeat(' ', max(0, $len - Helper::strlen($title))));
            foreach ($lines as $line) {
                $messages[] = sprintf('<error>  %s  %s</error>', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1]));
            }
            $messages[] = $emptyLine;
            $messages[] = '';

            $output->writeln($messages, OutputInterface::VERBOSITY_QUIET);

            if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
                $output->writeln('<comment>Exception trace:</comment>', OutputInterface::VERBOSITY_QUIET);

                // exception related properties
                $trace = $e->getTrace();
                array_unshift($trace, array(
                    'function' => '',
                    'file' => $e->getFile() !== null ? $e->getFile() : 'n/a',
                    'line' => $e->getLine() !== null ? $e->getLine() : 'n/a',
                    'args' => array(),
                ));

                for ($i = 0, $count = count($trace); $i < $count; ++$i) {
                    $class = isset($trace[$i]['class']) ? $trace[$i]['class'] : '';
                    $type = isset($trace[$i]['type']) ? $trace[$i]['type'] : '';
                    $function = $trace[$i]['function'];
                    $file = isset($trace[$i]['file']) ? $trace[$i]['file'] : 'n/a';
                    $line = isset($trace[$i]['line']) ? $trace[$i]['line'] : 'n/a';

                    $output->writeln(sprintf(' %s%s%s() at <info>%s:%s</info>', $class, $type, $function, $file, $line), OutputInterface::VERBOSITY_QUIET);
                }

                $output->writeln('', OutputInterface::VERBOSITY_QUIET);
            }
        } while ($e = $e->getPrevious());

        if (null !== $this->runningCommand) {
            $output->writeln(sprintf('<info>%s</info>', sprintf($this->runningCommand->getSynopsis(), $this->getName())), OutputInterface::VERBOSITY_QUIET);
            $output->writeln('', OutputInterface::VERBOSITY_QUIET);
        }
    }
127594
public static function html($message, $data = null)
    {
        if (!static::$on) {
            return;
        }

        echo "<hr>";
        echo "<i>";
            static::indent();
            echo "<b>" . static::getTime() . " - " . $message . "</b>";
            if (is_array($data)) {
                Html::print_r($data);
            } elseif ($data) {
                static::indent();
                echo "&nbsp;&nbsp;&nbsp;&nbsp;" . $data . "<br>";
            }
        echo "</i>";
    }
131375
protected function renderException($output, \Exception $e)
    {
        $this->laravel[ExceptionHandler::class]->renderForConsole($output, $e);
    }
314133
private function buildXml($data, \DOMDocument $doc, \DOMNode $parentNode = null)
    {
        if (is_array($data)) {
            foreach ($data as $elementName => $element) {
                if (is_int($elementName)) {
                    $elementName = 'item';
                }

                $newElement = $doc->createElement($elementName);

                if ($parentNode) {
                    $parentNode->appendChild($newElement);
                } else {
                    $doc->appendChild($newElement);
                }

                $this->buildXml($element, $doc, $newElement);
            }
        } else {
            $parentNode->nodeValue = $data;
        }
    }
64344
public function writeException(Exception $e)
    {
        $class = get_class($e);
        $text = $this->adapter->colorize("Exception - $class:\n{$e->getMessage()}\n", ColorInterface::LIGHT_RED);

        if ($this->isVerbose()) {
            $text .= "\n" . $this->renderTrace($e->getTrace()) . "\n";

            if ($this->isVeryVerbose() && ($previous = $e->getPrevious())) {
                $text .= "\n" . $this->adapter->colorize('Previous Exceptions:', ColorInterface::YELLOW) . "\n\n";

                do {
                    $class = $this->adapter->colorize(get_class($previous), ColorInterface::YELLOW);
                    $msg = $this->adapter->colorize($previous->getMessage(), ColorInterface::GRAY);
                    $text .= sprintf('%s: %s', $class, $msg)
                           . "\n" . $this->renderTrace($e->getTrace()) . "\n\n";
                } while ($previous = $previous->getPrevious());
            }
        }

        $this->adapter->writeLine($text);
    }
1169506
protected function failed($e)
    {
        $payload = $this->payload();

        [$class, $method] = JobName::parse($payload['job']);

        if (method_exists($this->instance = $this->resolve($class), 'failed')) {
            $this->instance->failed($payload['data'], $e);
        }
    }
867389
public function failed(array $data, $e)
    {
        $handler = $this->container->make($data['class']);

        $parameters = array_merge(unserialize($data['data']), [$e]);

        if (method_exists($handler, 'failed')) {
            call_user_func_array([$handler, 'failed'], $parameters);
        }
    }
454183
public function appException($e)
    {
        throw new ErrorException($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine(), $e->getTrace());

    }