Skip to content

Hability to output verbose message in GitException - #75

Open
PululuK wants to merge 1 commit into
czproject:masterfrom
PululuK:add-verbose-output
Open

Hability to output verbose message in GitException#75
PululuK wants to merge 1 commit into
czproject:masterfrom
PululuK:add-verbose-output

Conversation

@PululuK

Copy link
Copy Markdown

No description provided.

@janpecha

janpecha commented Feb 1, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
Author

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
Copy Markdown
Member

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
Copy Markdown
Author

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
Copy Markdown
Member

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

Sign up for freeto 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

@PululuK@janpecha