Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9aa3023

Browse files
committed
Adding more helpful error messages to the Questionhelper
1 parent940731f commit9aa3023

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎src/Symfony/Component/Console/Helper/QuestionHelper.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
271271
// as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false.
272272
if (false ===$c || ('' ===$ret &&'' ===$c &&null ===$question->getDefault())) {
273273
shell_exec('stty'.$sttyMode);
274-
thrownewMissingInputException('Aborted.');
274+
thrownewMissingInputException('Aborted while asking:'.$question->getQuestion());
275275
}elseif ("\177" ===$c) {// Backspace Character
276276
if (0 ===$numMatches &&0 !==$i) {
277277
--$i;

‎src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ public function testAskThrowsExceptionOnMissingInput()
750750
publicfunctiontestAskThrowsExceptionOnMissingInputForChoiceQuestion()
751751
{
752752
$this->expectException(MissingInputException::class);
753-
$this->expectExceptionMessage('Aborted.');
753+
$this->expectExceptionMessage('Aborted while asking: Choice');
754754
(newQuestionHelper())->ask($this->createStreamableInputInterfaceMock($this->getInputStream('')),$this->createOutputInterface(),newChoiceQuestion('Choice', ['a','b']));
755755
}
756756

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp