php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38639 Exception doesn't catch error
Submitted: 2006-08-29 07:20 UTC Modified: 2006-08-29 07:43 UTC
From: frmi at freemail dot hu Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.5 OS: any
Private report: No CVE-ID: None
 [2006-08-29 07:20 UTC] frmi at freemail dot hu
Description:
------------
Replying to: Bug #31745 

Yes, it is a bug, even if it is the planned behaviour.
At least it does not work simply like we use exception handling in other languages.
Either it is a design bug, or a documentation bug.
Something MUST be wrong with this, as there is no clear doc/tutorial/example that shows how to handle database or file handling or other exceptions.

At least documentation should clearly state that exception handling can only be used to handle exceptions what you thow
and not for exceptions thrown by functions.

Or better it should mention the trick (which I could not find anywhere) that exception can be thrown from error_handler (and give a simple example for that), and so it works similar to other languages.


Reproduce code:
---------------
try //or other keyword
    --code....
catch or exception or other keyword
    --code
end;


Expected result:
----------------
Should not give back php default error in case of any error.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-29 07:43 UTC] tony2001@php.net
.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 18 19:00:01 2025 UTC