Skip to content

Commit 293db04

Browse files
authored
Merge branch refs/heads/1.10.x into 1.11.x
2 parents de87990 + d6a576a commit 293db04

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Command/WorkerCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ private function runWorker(
199199
} catch (Throwable $t) {
200200
$this->errorCount++;
201201
$internalErrorsCount++;
202-
$internalErrorMessage = sprintf('Internal error: %s in file %s', $t->getMessage(), $file);
202+
$internalErrorMessage = sprintf('Internal error: %s while analysing file %s', $t->getMessage(), $file);
203203

204204
$bugReportUrl = 'https://github.com/phpstan/phpstan/issues/new?template=Bug_report.yaml';
205205
if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) {
206-
$internalErrorMessage .= sprintf('%sPost the following stack trace to %s: %s%s', "\n\n", $bugReportUrl, "\n", $t->getTraceAsString());
206+
$trace = sprintf('## %s(%d)%s', $t->getFile(), $t->getLine(), "\n");
207+
$trace .= $t->getTraceAsString();
208+
$internalErrorMessage .= sprintf('%sPost the following stack trace to %s: %s%s', "\n\n", $bugReportUrl, "\n", $trace);
207209
} else {
208210
$internalErrorMessage .= sprintf('%sRun PHPStan with -v option and post the stack trace to:%s%s', "\n", "\n", $bugReportUrl);
209211
}

0 commit comments

Comments
 (0)