Skip to content

Catch \Throwable #18812

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

Closed
wants to merge 3 commits into from
Closed

Conversation

fprochazka
Copy link
Contributor

@fprochazka fprochazka commented May 19, 2016

Q A
Branch? 2.3, 2.7, 2.8, 3.0
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? Yes
Fixed tickets n/a
License MIT
Doc PR n/a

Related #18765, #15949

This was referenced May 19, 2016
@nicolas-grekas
Copy link
Member

👍

@@ -77,6 +77,9 @@ public function load($resource, $type = null)
} catch (\Exception $e) {
$this->loading = false;
throw $e;
} catch (\Throwable $e) {
$this->loading = false;
throw $e;

Choose a reason for hiding this comment

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

in php7 isn't possible implements \Throwable interface only extends \Exception class, so why not use only one catch with \Throwable?

Copy link
Member

Choose a reason for hiding this comment

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

because we support PHP5 also

Copy link

@AyrtonRicardo AyrtonRicardo May 20, 2016

Choose a reason for hiding this comment

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

I got it

fabpot added a commit that referenced this pull request May 23, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

Catch \Throwable

| Q             | A
| ------------- | ---
| Branch?       | 2.7, 2.8, 3.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | Yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Related #18765, #15949
Depends on #18812

Commits
-------

103526b Catch \Throwable
fabpot added a commit that referenced this pull request May 23, 2016
This PR was merged into the 2.8 branch.

Discussion
----------

Catch \Throwable

| Q             | A
| ------------- | ---
| Branch?       | 2.8, 3.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | Mostly!
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The first commit is based on #15949
Depends on #18813, #18812

----

I'm new to symfony, so I'm not sure where are all the places where it makes sense to actually catch the throwable and where not. I added most places that seemed logical and when I wasn't sure, I added it anyway. I'm hoping you guys (and girls?) can point out the places where the catch should not be added, I'll fix it and then I can create several PR's for the older branches. A lot of this IMHO should go also to 3.0.

Commits
-------

de671f4 Catch \Throwable
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this pull request May 23, 2016
This PR was merged into the 2.8 branch.

Discussion
----------

Catch \Throwable

| Q             | A
| ------------- | ---
| Branch?       | 2.8, 3.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | Mostly!
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

The first commit is based on symfony/symfony#15949
Depends on symfony/symfony#18813, symfony/symfony#18812

----

I'm new to symfony, so I'm not sure where are all the places where it makes sense to actually catch the throwable and where not. I added most places that seemed logical and when I wasn't sure, I added it anyway. I'm hoping you guys (and girls?) can point out the places where the catch should not be added, I'll fix it and then I can create several PR's for the older branches. A lot of this IMHO should go also to 3.0.

Commits
-------

de671f4 Catch \Throwable
@nicolas-grekas
Copy link
Member

Thank you @fprochazka.

nicolas-grekas added a commit that referenced this pull request May 30, 2016
This PR was squashed before being merged into the 2.3 branch (closes #18812).

Discussion
----------

Catch \Throwable

| Q             | A
| ------------- | ---
| Branch?       | 2.3, 2.7, 2.8, 3.0
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | Yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Related #18765, #15949

Commits
-------

893cf00 Catch \Throwable
@fabpot fabpot mentioned this pull request May 30, 2016
@fprochazka fprochazka deleted the 2.3-php7-throwable branch June 6, 2016 13:03
This was referenced Jun 6, 2016
@fabpot fabpot mentioned this pull request Jun 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants