Skip to content

Commit

Permalink
Fix #123: Add an error trace display when an error is thrown (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
devanych committed Oct 19, 2021
1 parent 4a2108b commit 516626e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Application.php
Expand Up @@ -73,6 +73,8 @@ protected function doRenderThrowable(Throwable $e, OutputInterface $output): voi
$output->writeln('');
}
}

$output->writeln($e->getTraceAsString());
}

public function addOptions(InputOption $options): void
Expand Down
10 changes: 10 additions & 0 deletions tests/ApplicationTest.php
Expand Up @@ -56,6 +56,11 @@ public function testDoRenderThrowable(): void
'Test solution',
$output
);

$this->assertStringContainsString(
'StubCommand->execute(',
$output
);
}

public function testDoRenderThrowableWithStyledOutput(): void
Expand All @@ -80,6 +85,11 @@ public function testDoRenderThrowableWithStyledOutput(): void
'Test solution',
$output
);

$this->assertStringContainsString(
'StubCommand->execute(',
$output
);
}

public function testRenamedCommand(): void
Expand Down

0 comments on commit 516626e

Please sign in to comment.