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

Catch Throwable in Connection::transactional() #2390

Merged
merged 3 commits into from
May 26, 2016

Conversation

fprochazka
Copy link
Contributor

I was considering adding it to other places, that use "catch-all", but none of them can invoke user-provided code, so it makes little sense adding the catch there.

} catch (\RuntimeException $expected) {
$this->assertEquals(0, $this->_conn->getTransactionNestingLevel());
}
}

public function testTransactionalWithThrowable()
{
if (version_compare(PHP_VERSION, '7.0', '<')) {
Copy link
Contributor Author

@fprochazka fprochazka May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the convention for skipping tests in older php versions. If this is not good I can change it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use @requires php 7 in an annotation on this method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ocramius thanks, updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fprochazka did you push? I still see the if block

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did, and it failed hard #2390 (diff)

@@ -773,7 +774,7 @@ public function prepare($statement)
{
try {
$stmt = new Statement($statement, $this);
} catch (\Exception $ex) {
} catch (Exception $ex) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this because it was incosistent in this file (didn't look at the other files tho).

@deeky666
Copy link
Member

This is completly PHP7 related, isn't it? We cannot add this before 3.0.

@Ocramius
Copy link
Member

@deeky666 this is backward compliant too

@Ocramius
Copy link
Member

@deeky666 deeky666 added this to the 2.5.5 milestone May 26, 2016
@deeky666 deeky666 self-assigned this May 26, 2016
@deeky666 deeky666 merged commit 8aae77e into doctrine:master May 26, 2016
@deeky666
Copy link
Member

@fprochazka thanks! Responsibilities go out to @Ocramius :P

@Ocramius
Copy link
Member

I'm ready, should this go wrong

@fprochazka fprochazka deleted the php7-throwable branch May 26, 2016 17:49
@fprochazka
Copy link
Contributor Author

Thank you :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants