- $output->page(function ($output) use ($exception, $trace, $shell) {
- $shell->renderException($exception, $output);
+ $output->startPaging();
+ do {
+ $traceCount = count($exception->getTrace());
+ $showLines = $count;
+ // Show the whole trace if we'd only be hiding a few lines
+ if ($traceCount < max($count * 1.2, $count + 2)) {
+ $showLines = PHP_INT_MAX;
+ }
+
+ $trace = $this->getBacktrace($exception, $showLines);
+ $moreLines = $traceCount - count($trace);
+
+ $output->writeln($shell->formatException($exception));