e = $e;
}
public static function createForException(\Exception $e): ExceptionReporter
{
return new ExceptionReporter($e);
}
public function getExceptionTraceAsHtml()
{
return str_replace("\n", "
", $this->e->getTraceAsString());
}
public function getHtmlPage($reporterMessage): string
{
if (Identity::isManager()) {
$errorMessage = $this->e->getMessage();
$errorTrace = $this->getExceptionTraceAsHtml();
$errorHtml = <<
Error (only seen by manager):
$errorMessage
$errorTrace
EOF; } else { $errorHtml = "The error was logged in the log file. Errors are only visible by managers
"; } return <<$reporterMessage
$errorHtml EOF; } }