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

@PululuK PululuK commented Feb 1, 2022

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

PululuK commented Feb 1, 2022

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

janpecha commented Feb 1, 2022

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 PululuK force-pushed the add-verbose-output branch from 76b0c35 to 187af7d Compare February 1, 2022 18:16
@PululuK

PululuK commented Feb 1, 2022

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

janpecha commented Feb 2, 2022

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