Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hability to output verbose message in GitException #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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