Posted by larowlan on January 10, 2013 at 8:32pm
9 followers
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | entity system |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
Missing use Exception; so the catch (Exception $e) does not catch \Exception.
Patch and tests to follow.
Comments
#1
Patch with test demonstrating fail and then fix.
#2
Looks good to me.
#3
Not a documentation issue.
#4
sorry @jhodgdon
#5
This is somewhat minor, but AFAIK the standard is not to use Exception but instead to specify \Exception where it is used.
#6
Cross-post-o-rama!
#7
@webchick, http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/lib/D... has 'use Exception', I'm not fussy either way - can change both if you like.
#8
Yeah, that's wrong. The reason for that is because if you forget the "use Exception" thing at the top, then basically stuff doesn't work. Since it's not easy to grep for ensuring for every "Exception" there's a corresponding "use Exception", we introduced a standard to prefix it with "\" everywhere so offenders are easier to pick out. This is true for any internal PHP class: See http://drupal.org/node/1353118 under "use"ing classes.
#9
thanks, again in awe of how you keep all this in your head, new patch fixed both files.
sorry, no interdiff
#10
The last submitted patch, database-storage-controller-ng-1885542.9.patch, failed testing.
#11
related #1634442: DatabaseStorageController can't catch exceptions
#12
Not sure what happened there, fresh re-roll against HEAD.
#13
Looks sane enough.
#14
The last submitted patch, database-storage-controller-ng-1885542.12.patch, failed testing.
#15
I'm missing something. Hmmm
#16
meh, missed one
find and replace fail.
#17
Looks good. Marking back to RTBC so it can be committed once tesbot's done verifying.
#18
Good catch.
Can we have a test-only patch to prove the test?
#19
Wait for red/green.
#20
Great, thanks!
Committed and pushed to 8.x.
#21
Automatically closed -- issue fixed for 2 weeks with no activity.