An error occurred.

@param \PHPUnit_Framework_Test $test
@param \Exception              $e
@param float                   $time
542778
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
    {
        if (!$this->colors) {
            parent::addError($test, $e, $time);

            return;
        }

        $this->writeProgress(Coloring::magenta('E'));
        $this->lastTestFailed = true;
    }
769737
public function report(Exception $e)
    {
        if ($this->shouldntReport($e)) {
            return;
        }

        if (method_exists($e, 'report')) {
            return $e->report();
        }

        try {
            $logger = $this->container->make(LoggerInterface::class);
        }
        catch (Exception $ex) {
            throw $e; // Throw the original exception
        }

        $logger->error($e);
    }
380425
public function addToSection($section, $test, $filePath, $lineNumber, $codeLine) {
		if (empty($section)) {
			throw new \Exception(__METHOD__.": The section can not be empty.");
		}
		$this->sectionBuffers[$section][$filePath][$test][] = [$lineNumber, $codeLine];
	}
429358
public function logException(\Exception $e)
    {
        $error = $e->getMessage() . $e->getTraceAsString();
        return $this->logEmergency($error);
    }
652184
public function report(Exception $e)
    {
        try {
            $logger = Zilf::$container->getShare('log');
        } catch (Exception $ex) {
            throw $e;
        }

        $logger->error($e->getMessage(), ['exception' => $e]);
    }
604314
public static function raiseError(\Exception $e)
	{
		if(self::$debug)
			self::$debugData .= "Exception at " . basename($e->getFile()) . ":"
				. $e->getLine() . ": " . self::makePrintable($e->getMessage())
				. "\n";
	}
625742
protected function writeWarning(\PHPUnit_Framework_Test $test, \Exception $e, $time)
    {
        $this->writeFailureOrError($test, $e, $time, 'failure');
    }
1245937
protected function catchException(\Exception $e)
    {
        foreach ($this->onException as $call) {
            call_user_func_array($call, [$e]);
        }

        throw $e;
    }
315151
public function printFeedback(ExecutableTest $test)
    {
        try {
            $reader = new Reader($test->getTempFile());
        } catch (\InvalidArgumentException $e) {
            throw new \RuntimeException(sprintf(
                "%s\n" .
                "The process: %s\n" .
                "This means a PHPUnit process was unable to run \"%s\"\n",
                $e->getMessage(),
                $test->getLastCommand(),
                $test->getPath()
            ));
        }
        $this->results->addReader($reader);
        $this->processReaderFeedback($reader, $test->getTestCount());
        $this->printTestWarnings($test);
    }
546259
protected function renderException($request, Exception $e)
    {
        return $this->app[Handler::class]->render($request, $e);
    }
1026866
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
    {
        $message = 'raised an error';
        $this->write(
            $this->colors ? Coloring::magenta($message)
                          : $message
        );

        parent::addError($test, $e, $time);
    }
805256
public void log(Exception e, Object... elements) {
		if(willWrite.compareTo(Level.ERROR)<=0) {
			StringBuilder sb = buildLine(Level.ERROR, new StringBuilder(),elements);
		
			if(context==null) {
				sb.append(e.toString());
				System.out.println(sb.toString());
			} else {
				context.log(sb.toString(),e);
			}
		}
	}
24771
public function addWarning(Test $test, Warning $warning, float $time): void
    {
        $this->writeCase(
            self::STATUS_WARNING,
            $time,
            $this->getStackTrace($warning),
            TestFailure::exceptionToString($warning),
            $test
        );

        $this->currentTestPass = false;
    }
289753
public function error(\Exception $e)
    {
        if ($this->beep_on_error === true) {
            \Commando\Util\Terminal::beep();
        }

        if ($this->trap_errors !== true) {
            throw $e;
        }

        $color = new \Colors\Color();
        $error = sprintf('ERROR: %s ', $e->getMessage());
        echo $color($error)->bg('red')->bold()->white() . PHP_EOL;
        exit(1);
    }
575312
public static function ini($test = null)
    {
        self::getSupported();

        self::$lang = self::detect($test);

        exception_if(!in_array(self::$lang, self::$supported), LanguageNotSupportedException::class, self::$lang);

        self::load();
    }
485230
public function addFailure(Test $test, AssertionFailedError $failure, float $time): void
    {
        if ($test instanceof TestCase and $test->is_driver_active() and $test->driver()->is_page_active()) {
            $this->save_driver_content(
                $test->driver(),
                \get_class($test).'_'.$test->getName(false),
                $failure->getMessage()
            );
        }
    }
1183347
public function render($request, Exception $e)
    {
        if ($this->isServiceException($e)) {
            $e->setRequest($request);
        } elseif ($e instanceof ValidationException) {
            $e = $this->convertValidationExceptionToEntityException($e);
        } else {
            $e = $this->convertExceptionToServiceException($e);
        }

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