From bce5c5f5fdb87c38c26f167fa9f1570c10754c36 Mon Sep 17 00:00:00 2001 From: Thomas Flori Date: Mon, 3 Dec 2018 10:11:08 +0100 Subject: [PATCH] suggested changes for previous output in plaintext handler --- src/Whoops/Handler/PlainTextHandler.php | 4 ++-- tests/Whoops/Handler/PlainTextHandlerTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Whoops/Handler/PlainTextHandler.php b/src/Whoops/Handler/PlainTextHandler.php index bd9105ee..192d0ffd 100644 --- a/src/Whoops/Handler/PlainTextHandler.php +++ b/src/Whoops/Handler/PlainTextHandler.php @@ -176,7 +176,7 @@ public function generateResponse() if ($this->addPreviousToOutput) { $previous = $exception->getPrevious(); while ($previous) { - $message .= "\nBefore: " . $this->getExceptionOutput($previous); + $message .= "\n\nCaused by\n" . $this->getExceptionOutput($previous); $previous = $previous->getPrevious(); } } @@ -313,7 +313,7 @@ private function getTraceOutput() * @param \Throwable $exception * @return string */ - protected function getExceptionOutput($exception) + private function getExceptionOutput($exception) { return sprintf( "%s: %s in file %s on line %d", diff --git a/tests/Whoops/Handler/PlainTextHandlerTest.php b/tests/Whoops/Handler/PlainTextHandlerTest.php index bda09576..4b92fcc1 100644 --- a/tests/Whoops/Handler/PlainTextHandlerTest.php +++ b/tests/Whoops/Handler/PlainTextHandlerTest.php @@ -267,7 +267,7 @@ public function testReturnsWithPreviousExceptions() 'Outer exception message', __FILE__, 258, - 'Before: ' . RuntimeException::class, + "\nCaused by\n" . RuntimeException::class, 'Inner exception message', __FILE__, 258