Skip to content

Conversation

PululuK
Copy link

@PululuK PululuK commented Feb 1, 2022

No description provided.

@janpecha
Copy link
Contributor

janpecha commented Feb 1, 2022

Hello, thanks for PR. Why you need this change? You can just use:

try {
    // $git->open()
    // $gitRepository->xyz()

} catch (CzProject\GitPhp\GitException $e) {
    $e->getRunnerResult()->toText();
}

@PululuK
Copy link
Author

PululuK commented Feb 1, 2022

Hello @janpecha

Exactly the ideia is to avoid to call runner, and access directly toText message int default Exception::getMessage if verbose mode is enabled of course.

@janpecha
Copy link
Contributor

janpecha commented Feb 1, 2022

It seems useless for me. If I can call Exception::getMessage() I can call $e->getRunnerResult()->toText() too.

What about to add new method GitException::getVerboseMessage() - then you can call $e->getVerboseMessage()?

@PululuK PululuK force-pushed the add-verbose-output branch from 76b0c35 to 187af7d Compare February 1, 2022 18:16
@PululuK
Copy link
Author

PululuK commented Feb 1, 2022

It seems useless for me. If I can call Exception::getMessage() I can call $e->getRunnerResult()->toText() too.

What about to add new method GitException::getVerboseMessage() - then you can call $e->getVerboseMessage()?

You are right @janpecha !
Thanks

@janpecha
Copy link
Contributor

janpecha commented Feb 2, 2022

Nice! Can you fix static analysis & code style errors please? And change commit message to something like GitException: added method getVerboseMessage().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants