-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
instead of just catching Exception
#5796
Conversation
Is something blocking this, or you guys just haven't had time to look at this? Also, the same problem is in dbal (I've created a PR for it doctrine/dbal#2390 ) |
@fprochazka we're simply stuck outside the githubs. |
@@ -749,7 +751,9 @@ public function dropSchema(array $classes) | |||
foreach ($dropSchemaSql as $sql) { | |||
try { | |||
$conn->executeQuery($sql); | |||
} catch (\Exception $e) { | |||
} catch (\Throwable $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that i think about it, this one probably shouldn't caught.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Godd catch. Indeed, this should halt execution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another issue then :)
What's the deal with this one? Shouldn't this get merged? |
@rreynier see comments above? |
@Ocramius what do you mean by being stuck outside of GitHub? |
Paid work, but also missing clean-up work to be done here. I can work on it
today tho.
…On 1 Sep 2017 08:47, "Roeland Reyniers" ***@***.***> wrote:
@Ocramius <https://github.com/ocramius> what do you mean by being stuck
outside of GitHub?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5796 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakLWOe-Zvj1mHbGmCrRv9K4EFxVb8ks5sd6h0gaJpZM4INGvA>
.
|
Throwable
instead of just catching Exception
Several code blocks have a catch-all
catch (\Exception) { ... }
. This is OK in PHP 5, but not sufficient in PHP 7, as the new base interface isThrowable
, and catchingException
does not catchError
instances.This PR catches
Throwable
by default, then catchesException
for PHP 5. The fact thatThrowable
is not defined in PHP 5 is not a problem in a catch block.This leads to a bit of code duplication, but there's not much we can do to avoid this I'm afraid.