php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22901 Error message for uncaught exception not very informative
Submitted: 2003-03-26 08:29 UTC Modified: 2003-07-05 10:20 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mfischer@php.net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5CVS-2003-03-26 (dev) OS: Linux
Private report: No CVE-ID: None
 [2003-03-26 08:29 UTC] mfischer@php.net
The error message for uncaught exceptions is not very informative.

-------------8<----------------
Example:
$ cat exception.php
<?php
        class dummy_exception {
        }
        throw new dummy_exception;
?>

$ php exception.php

Fatal error: Uncaught exception! in Unknown on line 0
Unknown(0) : Fatal error - Uncaught exception!
-------------8<----------------

It doesn't matter whether the throw statement is in a function/class or not.

A few things which should be considered worth improving this message:
- in which file is it thrown ("Unknown" ?)
- on which line is it thrown ("0" ?)

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-26 19:14 UTC] mfischer@php.net
Another small note:

No idea why it hast to be called "Uncaught exception!" with a trailing bang but reading it in a message like

Fatal error: Uncaught exception! in Unknown on line 0

doesn't fit well. 

Any plans to remove this?
 [2003-04-19 12:05 UTC] thekid at thekid dot de
thekid@friebes:~ > cat | php5
<?php
        class dummy_exception {
        }
        throw new dummy_exception;
?>
^D
Fatal error: Uncaught exception 'dummy_exception'! in Unknown on line 0

At least we've gotten a bit farther:)
 [2003-07-05 10:20 UTC] sterling@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Its informative enough :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 11:01:29 2024 UTC