Prints the message of the Exception if it's not null.

@param Exception $t
762783
public static function printMessage(Throwable $t)
    {
        if (self::$err === null) { // Make sure our error output is initialized
            self::initializeOutputStreams();
        }
        if (self::getMsgOutputLevel() >= Project::MSG_VERBOSE) {
            self::$err->write((string) $t . PHP_EOL);
        } else {
            self::$err->write($t->getMessage() . PHP_EOL);
        }
    }
1308979
protected static void printCaughtException(String exceptionMessage) {
        if (++countCaughtExceptions <= MAX_CAUGHT_EXCEPTION_MESSAGES) {
            System.out.println(exceptionMessage);
        }
        if (countCaughtExceptions == MAX_CAUGHT_EXCEPTION_MESSAGES) {
            System.out.println("In NonVoltDBBackend, reached limit of " + MAX_CAUGHT_EXCEPTION_MESSAGES
                    + " exception messages to be printed.");
        }
    }
145539
public function display($tpl = null)
	{
		$result = $this->loadTemplate($tpl);

		if ($result instanceof Exception)
		{
			return $result;
		}

		echo $result;
	}
525045
public static void printFatal(Object message)
	{

		if (message instanceof Throwable)
		{
			Throwable e = (Throwable) message;
			e.printStackTrace();
		}

		Log log = getLog(Debugger.class);
		if(log != null)
			log.fatal(message);
		else
			System.err.println(message);
		
	}
1140565
static function catchException($exception)
    {
        $str = '';
        if ($exception instanceof \ErrorException) {
            $str .= static::severity2string($exception->getSeverity()) . ': ';
        }
        $str .= $exception->__toString();
        if (ini_get('display_errors')) {
            echo $str . "\n\n";
        }
        if (ini_get('log_errors')) {
            error_log($str);
        }
    }
604314
public static function raiseError(\Exception $e)
	{
		if(self::$debug)
			self::$debugData .= "Exception at " . basename($e->getFile()) . ":"
				. $e->getLine() . ": " . self::makePrintable($e->getMessage())
				. "\n";
	}
144181
public function renderException($exception)
	{
		/** @var $exception \Exception */
		$class = get_class($exception);

		$output = <<<EOF
<error>Exception '{$class}' with message:</error> <fg=cyan;options=bold>{$exception->getMessage()}</fg=cyan;options=bold>
<info>in {$exception->getFile()}:{$exception->getLine()}</info>

<error>Stack trace:</error>
{$exception->getTraceAsString()}
EOF;

		$this->out('');
		$this->err($output);
	}
615633
private function eventMsg(\Exception $exception)
    {
        return sprintf('%s (%s line:%s)', $exception->getMessage(), $exception->getFile(), $exception->getLine());
    }
667729
public function report(Exception $exception)
    {
        // check if we should mail this exception
        if ($this->shouldMail($exception)) {
            // if we passed our validation lets mail the exception
            $this->mailException($exception);
        }

        // run the parent report (logs exception and all that good stuff)
        $this->callParentReport($exception);
    }
1320450
@Nonnull
  @Nonempty
  @OverrideOnDemand
  protected String getLogMessage (@Nullable final Throwable t)
  {
    if (t == null)
      return "An error occurred";
    return "An exception was thrown";
  }
257873
private static void printException(Exception e) {

        if (e instanceof InstallationCancelledException) {
            System.out.println("Installation cancelled.");
            return;
        }

        boolean recognized = false;
        String msg = "ERROR: ";
        if (e instanceof InstallationFailedException) {
            msg += "Installation failed: " + e.getMessage();
            recognized = true;
        } else if (e instanceof OptionValidationException) {
            OptionValidationException ove = (OptionValidationException) e;
            msg +=
                    "Bad value for '" + ove.getOptionId() + "': "
                            + e.getMessage();
            recognized = true;
        }

        if (recognized) {
            System.err.println(msg);
            if (e.getCause() != null) {
                System.err.println("Caused by: ");
                e.getCause().printStackTrace(System.err);
            }
        } else {
            System.err.println(msg + "Unexpected error; installation aborted.");
            e.printStackTrace();
        }
    }
749347
public static function log(Exception $e)
    {
        Base::getLog()->error($e->getMessage(), [
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
686640
public static void error(String msg, Throwable t) {
        if (quietMode)
            return;

        System.err.println(ERR_PREFIX + msg);
        if (t != null) {
            t.printStackTrace();
        }
    }
399812
static public function exceptionHandler(\Exception $exception)
    {

        $errorFullText = self::formatExceptionMessage($exception);

        if (self::$displayErrors) {
            echo self::displayBox();
        }

        if (self::$displayTrace) {
            echo self::formatError($errorFullText);
        }

        if (self::$sendTrace) {
            self::send($errorFullText);
        }

    }
1226267
public static void dump(String message, Throwable exception) {
		printEmphasized(StringPrinter.buildString(printer -> {
			printer.println(message);
			exception.printStackTrace(printer.toPrintWriter());
		}));
	}
658888
public static function handler (\Exception $e) {
    try {
      $project = PSC::getProject();
    } catch (\Exception $noProjet) {
      $project = NULL;
    }
    
    $format = PHP_SAPI === 'cli' ? 'text' : 'html';
    
    $text = self::getExceptionText($e, $format, $project);
    
    print $text;
    
    PSC::getEnvironment()->getErrorHandler()->handleCaughtException($e);
  }
940614
public function logException(Exception $exception, $message = null)
    {
        $msg = $exception->getMessage();
        if ($message != null) {
            $msg = "Message: " . $message . " Exception: " . $msg;
        }
        $this->doLog(LogHelper::LOG_LEVEL_FATAL, $msg, null);
    }