Bug #66425 [NEW]: Misleading fatal error with nested exceptions
| From: | r dot wilczek at web-appz dot de | Date: | Mon, 06 Jan 2014 11:24:25 +0000 |
| Subject: | Bug #66425 [NEW]: Misleading fatal error with nested exceptions | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-183608@lists.php.net to get a copy of this message | ||
From: r dot wilczek at web-appz dot de
Operating system: Linux
PHP version: 5.5.7
Package: *General Issues
Bug Type: Bug
Bug description:Misleading fatal error with nested exceptions
Description:
------------
Exceptions nesting a previous exception result in misleading
error-reports.
In the test script below, Foo was actually caught and nested in an
uncaught Bar.
The resulting fatal error errorneously suggests, that Foo was not
caught.
Test script:
---------------
class Foo extends \Exception {};
class Bar extends \Exception {};
try {
throw new Foo('Foo-message');
} catch (Foo $e) {
throw new Bar('Bar-message', 4711, $e);
}
Expected result:
----------------
Fatal error: Uncaught exception 'Bar' with message 'Bar-message' in
test.php on line 8
Foo: Foo-message in test.php on line 6
Call Stack:
0.0002 269440 1. {main}() test.php:0
Bar: Bar-message in test.php on line 8
Call Stack:
0.0002 269440 1. {main}() test.php:0
Actual result:
--------------
Fatal error: Uncaught exception 'Foo' with message 'Foo-message' in
test.php on line 8
Foo: Foo-message in test.php on line 6
Call Stack:
0.0002 269440 1. {main}() test.php:0
Bar: Bar-message in test.php on line 8
Call Stack:
0.0002 269440 1. {main}() test.php:0
--
Edit bug report at https://bugs.php.net/bug.php?id=66425&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66425&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66425&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66425&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66425&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66425&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66425&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66425&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66425&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66425&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66425&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66425&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66425&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66425&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66425&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66425&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66425&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66425&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66425&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66425&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66425&r=mysqlcfg